PDA

View Full Version : Pop-it menu Help!



allieatcomputrex
03-09-2009, 01:09 PM
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 :)

allieatcomputrex
03-09-2009, 01:46 PM
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.

ddadmin
03-09-2009, 08:06 PM
If you need the drop down menu to be anchored on the page, you should look at AnyLink Drop Down Menu (http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm) instead.

allieatcomputrex
03-12-2009, 05:31 AM
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?

Sachmet
04-02-2009, 04:27 AM
I am trying to use this as well, and have come across the same problem. When the

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.