Solved

OnClick Popup Div

Posted on 2007-03-29
7
717 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

757 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

20 Experts available now in Live!

Get 1:1 Help Now