View Full Version : Overlapping Content script Location of Div
1) Script Title: Drop down/ Overlapping Content script
2) Script URL (on DD): http://dynamicdrive.com/dynamicindex5/overlapcontent.htm
3) Describe problem: When clicked, I would like the DIV to appear in the middle of the page..
I would be grateful for any help.
Ok I kind of made a hack job here that works for me:
Replace the javascript code with this from "function overlay(curobj, subobjstr, opt_position)"
function overlay(curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr)
subobj.style.display=(subobj.style.display!="block")? "block" : "none"
var IpopTop = (document.body.clientHeight - document.getElementById(subobjstr).offsetHeight) / 2;
var IpopLeft = (document.body.clientWidth - document.getElementById(subobjstr).offsetWidth) / 2;
var xpos=document.getElementById(subobjstr).style.left=IpopLeft + document.body.scrollLeft;
var ypos=document.getElementById(subobjstr).style.top=IpopTop + document.body.scrollTop;
subobj.style.left=xpos+"px"
subobj.style.top=ypos+"px"
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.