PDA

View Full Version : AnyLink JS Drop Down Menu v2.0



mml
08-16-2010, 07:32 AM
1) Script Title: drop down menu - align to the right

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm

3) Describe problem: align to right

Thanks for permit me to get help.

In my language I have to align to the right. so I want that all the div with the links of the sub menu to align too to the right like this:
http://www.beshvil.com/img/drop%20down%20menu.GIF
Not the default align.
how can I do this?

Thanks a lot

vwphillips
08-16-2010, 08:51 AM
showmenu:function(menuid){
var menu=anylinkmenu.menusmap[menuid]
clearTimeout(menu.hidetimer)
this.getoffsetof(menu.anchorobj);
var x=menu.anchorobj._offsets.left;
x+=(menu.anchorobj.offsetWidth-menu.dropmenu.offsetWidth)
this.getdimensions(menu)
var posx=Math.max(x + (menu.orientation=="lr"? this.dimensions.anchorw : 0),0) //base x pos
var posy=menu.anchorobj._offsets.top+this.dimensions.anchorh - (menu.orientation=="lr"? this.dimensions.anchorh : 0)//base y pos
if (posx+this.dimensions.dropmenuw+this.effects.shadow.depth[0]>this.dimensions.docscrollx+this.dimensions.docwidth){ //drop left instead?
posx=posx-this.dimensions.dropmenuw + (menu.orientation=="lr"? -this.dimensions.anchorw : this.dimensions.anchorw)
}
if (posy+this.dimensions.dropmenuh>this.dimensions.docscrolly+this.dimensions.docheight){ //drop up instead?
posy=Math.max(posy-this.dimensions.dropmenuh - (menu.orientation=="lr"? -this.dimensions.anchorh : this.dimensions.anchorh), this.dimensions.docscrolly) //position above anchor or window's top edge
}
if (this.effects.fade.enabled){
this.setopacity(menu.dropmenu, 0) //set opacity to 0 so menu appears hidden initially
if (this.effects.shadow.enabled)
this.setopacity(menu.shadow, 0) //set opacity to 0 so shadow appears hidden initially
}
menu.dropmenu.setcss({left:posx+'px', top:posy+'px', visibility:'visible'})
if (this.effects.shadow.enabled){
//menu.shadow.setcss({width: menu.dropmenu.offsetWidth+"px", height:menu.dropmenu.offsetHeight+"px"})
menu.shadow.setcss({left:posx+anylinkmenu.effects.shadow.depth[0]+'px', top:posy+anylinkmenu.effects.shadow.depth[1]+'px', visibility:'visible'})
}
if (this.effects.fade.enabled){
clearInterval(menu.animatetimer)
menu.curanimatedegree=0
menu.starttime=new Date().getTime() //get time just before animation is run
menu.animatetimer=setInterval(function(){anylinkmenu.revealmenu(menuid)}, 20)
}
},

mml
08-16-2010, 11:56 AM
Thank you vic but forgive me for being un skilled. Can you explain me what to do with that cod?

vwphillips
08-16-2010, 12:50 PM
replace the current AnyLink JS Drop Down Menu v2.0 script with the attached code

mml
08-16-2010, 04:49 PM
Hi vic,
I did replace the attached code in the file anylinkmenu.js, as I understand, but it stoped the drope menu at all.

vwphillips
08-16-2010, 05:05 PM
post a link to your page

mml
08-17-2010, 07:45 AM
I attached the relevant files and a link to the page. the anylinkmenu.js is the same as the original.
sample page (http://www.beshvil.com/sample/sample.html)

vwphillips
08-17-2010, 10:08 AM
works for me using IE and FF

see attachment

mml
08-17-2010, 06:43 PM
Thanks a lot for helping me so much.
It works for me too.

mml
08-17-2010, 09:04 PM
Every thing in place and work successfully.
Thank you.