PDA

View Full Version : Script not compatible to all link types?



ARCLite Studio
11-06-2011, 03:21 AM
***** Problem resolved through use of different script, but feel free to provide an answer on this one if you can, would still be useful *****



1) Script Title: Drop down/ Overlapping Content script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/overlapcontent.htm

3) Describe problem: I have a large image of a tour map through a historic section of a town, the map has about 15 locations that are "stops" on the tour route designated by #'s in small circles. - I am trying to create a "content rich" div pop-up on mouse over or click of each circle, thus I am having to use an image map to build the links. - This script is perfect when used on a text link except that I need to manually tell the script the position the DIV needs to pop up, not the preset positions the script uses "top-left" :bottom-right" etc. etc.

The problem being created is that the script when in executes using the links of an image map relates "top-left" "bottom-right" and the other preset positions in relation to the IMAGE used in the image map, not the hot spot the link is located at. - I am not a coder, but I did look at the JS code and noticed line 38 through 41 APPEARS to indicate that a user value can somehow be passed to the script for manual positioning:



var horizontaloffset=(subobj.dropposition[0]=="left")? -(subobj.offsetWidth-anchorobj.offsetWidth) : 0 //calculate user added horizontal offset

var verticaloffset=(subobj.dropposition[1]=="top")? -subobj.offsetHeight : anchorobj.offsetHeight //calculate user added vertical offset

subobj.style.left=this.getposOffset(anchorobj, "offsetLeft") + horizontaloffset + "px"
subobj.style.top=this.getposOffset(anchorobj, "offsetTop")+verticaloffset+"px"

Am I misunderstanding the sections above? and in any case, is there anything someone can do to help get this script to accept a "top" and "left" variable to manually position the DIV's?

Thanks in advance,

Robert