Solved

OnClick Popup Div

Posted on 2007-03-29
7
722 Views
Last Modified: 2008-02-01
On a click, i want a div to popup at that position and only one at a time .... so there might be 5 or 10 of this clickable spots and anytime one of those psots is clicked I want that 1 and only div to show up there.
0
Comment
Question by:B_Dorsey
  • 4
  • 3
7 Comments
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18821222
http://www.rodsdot.com/ee/popOverForm.asp

Will give you the basic tools.  Code is in the page.

What you want to do is add a var for currentPoped="divId';

When you process the onclick, if currentPoped != "" then hide that div, pop the new div and set currentPoped to that div's ID.

Regards,
Rod
0
 
LVL 29

Accepted Solution

by:
rdivilbiss earned 500 total points
ID: 18821349
Actually this is probably better for you.

http://www.rodsdot.com/ee/multipleDivisionPops.asp
0
 
LVL 14

Author Comment

by:B_Dorsey
ID: 18822757
the second one you provided has a error I think...

if the clickable objects are not in the top part of the window (lets say I have to browse down the page to see them) then when I click them, it moves me to the top of the page and the new div shows up way off position.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18824019
It works for me in IE7, FF 2, and Opera 9...what browser are you using?
0
 
LVL 14

Author Comment

by:B_Dorsey
ID: 18824909
its not that its not working, its working incorrectly...

Lets say I have a page that has ALOT of content on it, and I click the link to bring up one of these popups... well it resets the page to the top and puts the popup div near the top.
0
 
LVL 14

Author Comment

by:B_Dorsey
ID: 18824914
just to clarify...

go to your page there and scroll it down till you BARELY see the links in that page... then clic one,, does it move the page to the top and the popup dive waaaaay away from the original link?
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 18825132
Oh that's just a missing return false, which caused the href="#" to execute.

http://www.rodsdot.com/ee/images/multiPop.jpg

It's fixed.

Here is why you experienced the problem in the demo.

http://www.rodsdot.com/ee/Why-JavaScript-In-Hyperlinks-Is-Bad.asp
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now