View Full Version : Anylink drop down menu, moving it to the right?
droomagon
09-15-2004, 01:08 AM
http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm
the script works wonderfully, but I have a question regarding to its position, instead of dropping down right underneath, is it possible of moving it to pop on the right side instead? :)
/cheers!
ddadmin
09-15-2004, 09:03 PM
Well, the line:
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
controls the left offset of the menu. To make the menu appear to the right of the link, you can modify it to:
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
The addition of "obj.offsetWidth" increases the left offset to include the width of the link itself.
droomagon
09-16-2004, 04:11 AM
Thanks ddadmin !!!!
kbrooks
09-23-2004, 11:59 AM
This is great! Any way to get it to move only slightly to the right, and not clear to the right edge of the link? Like a certain number of pixels?
gigabites
09-23-2004, 02:26 PM
If You want to move 10 pixels to the right :
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+10+"px"
kbrooks
09-23-2004, 03:03 PM
Amazing how simple that is. Thank you very much!
gigabites
09-23-2004, 03:46 PM
You're welcome :)
bfisher
11-08-2004, 07:57 PM
Along the same lines, is there a way to align it at the top of an object? I ask because I've put the rollover code in a table cell and would like the menu to display at the to and to the right of the cell. Thanks in advance. Keep up the great work!
bfisher
11-08-2004, 08:07 PM
I answered my own question. Just goes to show that when you get to the point where you want to quit. Swear at it a little bit and then try again! ;)
Here's what I did:
On this line,
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottom")+obj.offsetHeight+"px"
Remove:
+obj.offsetHeight+"px"
Voila!
adelsun
04-25-2005, 12:08 AM
I have the same question but regarding to the position of Pop-it menu
http://www.dynamicdrive.com/dynamicindex1/popit.htm
Where is, I suppose, no dropmenuobj. Also how can I align the sub-menu to the right.
Thanks
Renegade
07-27-2005, 08:25 PM
Hi Guys,
I have a quick question along the same lines as bfisher's alignment problem...
Is there any way to have the menu's pop up, instead of down? I tried playing with the dropmenuobj.style's top parameter but that sets the top value for all of the menus, and if there are a different number of items in each one, they won't all be popping upwards, from the same spot. I believe it's because the menu is built from the top down... maybe I could change it so it builds bottom up?
This is sort of what i'm going for, ascii style.
[pop up two]
[pop up one] [pop up one]
-------------------------------
[menu 1] [menu 2]
Anyway... I've looked at the code for a while and haven't figured it out yet and could use some help :)
Thanks a lot guys :)
Renegade
07-28-2005, 12:29 PM
Hey Guys,
Eh, I just thought of a quick solution. I added a parameter to the dropdownmenu function that's responsible for vertically offsetting an ammount for that specific menu.
Heh, I don't know why I didn't just do that in the first place :P
Ah well, thanks for writing this sweet lil' dhtml nugget. It's got to be the best menu i've seen ^_^
Riete
08-17-2005, 05:26 PM
Hi
When i go on a menu, the sub-menu's drop under each other.
Is it possible to drop them next to each other so you get something like this.
Menu
Sub Sub Sub Sub ....
???
And i found how to change the yellow colour but i can't find how to change the red text into white or something else.
Thanks
Is it possible to add a pop up page with the below code like:-
<A class="pop" HREF="javascript:void(0)" ONCLICK="open('/???/default.asp','miniwin','scrollbars=1,width=568,height=450')">
it would be excellent if anyone has a solution to this.
I have tried placing the above into the link but doesn't want to work.
Any help useful. Cheers.
heraldmonkey
12-30-2008, 09:12 AM
This script is wonderful, and I'm trying to adapt it for use in a right-aligned menu (direction:rtl). Does anyone know how to tweak the code so it displays the dropdowns from the right edge of the screen instead of the left edge?
Thanks a lot!!
thirdcherry
01-18-2009, 07:59 AM
in the "horizontal offset" just use a negative number.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.