Results 1 to 5 of 5

Thread: Pop-it menu Help!

  1. #1
    Join Date
    Mar 2009
    Location
    philadelphia
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Pop-it menu Help!

    1) Script Title:
    Pop-it menu
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex1/popit.htm
    3) Describe problem:
    I am having trouble. I wanted to make this pop-it menu stable but I have no idea how to tackle the problem. It says that it is "loose" but I need it to stay in one spot.
    Please help.
    Thanks
    Allie

  2. #2
    Join Date
    Mar 2009
    Location
    philadelphia
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I was fooling around with the code and I got all the pop-it menus to stay in one spot on the x and y axis and this is the code I changed

    eventX="500"
    eventY="175"


    //Find out how close the mouse is to the corner of the window
    var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
    var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
    //if the horizontal distance isn't enough to accomodate the width of the context menu
    if (rightedge<menuobj.contentwidth)
    //move the horizontal position of the menu to the left by it's width
    menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
    else
    //position the horizontal position of the menu where the mouse was clicked
    menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
    //same concept with the vertical position
    if (bottomedge<menuobj.contentheight)
    menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
    else
    menuobj.style.top=ie5? iecompattest().scrollTop+eventY+"px" : window.pageYOffset+eventY
    menuobj.style.visibility="visible"

    And it works, but when I scroll down the page it disappears, please help! I'm desperate.

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    If you need the drop down menu to be anchored on the page, you should look at AnyLink Drop Down Menu instead.
    DD Admin

  4. The Following User Says Thank You to ddadmin For This Useful Post:

    allieatcomputrex (03-12-2009)

  5. #4
    Join Date
    Mar 2009
    Location
    philadelphia
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    yeah I had looked at that code but I was having a lot of trouble with it. Is there any way that I can do it with this code instead?

  6. #5
    Join Date
    Dec 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I am trying to use this as well, and have come across the same problem. When the
    Code:
    eventX="500"
    eventY="175"
    are set like allieatcomputrex said in his second post and you scroll down it goes 122,000+ pixels to the bottom of the page. I have also looked at the other but doesn't work as well with what I am wanting. So any help to get this to work would be wonderful.

    Thanks in advance.

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
  •