View Full Version : positioning dropdown/overlap content

11-28-2006, 11:02 AM
1) Script Title: overlapcontent probelm

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

3) Describe problem: i would like to adjust the position of the dropped down
div to a certain point on the screen. since switching between the "right" ,"bottom" and "bottomright" is not specific enough i tried changing the script
that's incharge of the position at the head section but nothing happens.
can someone help?


11-28-2006, 11:41 AM
1.Comment the overlay() in the original script.

2. put the following function in place of overlay()

function overlay(curobj, subobjstr, left, top){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"

subobj.style.top = top
subobj.style.left = left

return false
return true

3. Change the existing overlay() function calls like the following

<b><a href="search.htm" onClick="return overlay(this, 'subcontent',5,50)">Search DD</a></b><br />

<p style="padding-left: 800px"><b><a href="search.htm" onClick="return overlay(this, 'subcontent2', 0, 80)">Show Content</a></b><br />

4. I've modified the code based on the original script.

11-28-2006, 04:03 PM
Hi thanks Code Exploiter, but i can't get the positioning to work
after changing the function and adding values to the call, the div gets stuck
to a certain point on the screen and changing the values does not influence its position.

appriciate yr help