Results 1 to 3 of 3

Thread: Overlapping Content script Location of Div

  1. #1
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Overlapping Content script Location of Div

    1) Script Title: Drop down/ Overlapping Content script

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex...lapcontent.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.

  2. #2
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Any help with this?

  3. #3
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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)"


    Code:
    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"

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •