PDA

View Full Version : Drop down with Overlapping Content script



DDmUSA
09-09-2011, 08:45 AM
I wanted to use the following tooltip script on one of my pages:

Drop down with Overlapping Content script (http://www.dynamicdrive.com/dynamicindex5/overlapcontent.htm)

My sample page (http://gaboncentral.com/sample1/) contains a section with a vertical scroll.

Each "Embassy" link within the government sections has been set to trigger the tooltip. However, the second government section and embassy link does not appear to trigger the tooltip to appear near the anchor link.

What code would have to be modified in order for the tooltip to appear near the position of the anchor link at the time of the click?

ddadmin
09-12-2011, 08:46 PM
Untested, but inside dropdowncontent.js, try adding the code in red to the below line:


subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset-document.getElementById('container').scrollTop+"px"

It manually accounts for any scroll offset done inside your container "#container".

DDmUSA
09-13-2011, 05:13 AM
The above insertion was helpful, but why is it necessary to click the second embassy link two times before the informational box appears on the screen? When the second appearance of the embassy link is clicked once, the screen flickers, and the second click causes the information box to appear as desired.

DDmUSA
09-13-2011, 05:31 AM
I may have answered my own question. I noticed that I had one DIV in front of the script. I moved the script that initializes the informational box to the end of the code just before the end of the body, and I think it is okay now. Thanks for the adjustment to the code. Perhaps you should make the adjustment a standard part of the script that's posted on the site.