Solved

OnClick Popup Div

Posted on 2007-03-29
7
725 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

789 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