PDA

View Full Version : Resolved Genius needed: Modify a DD script



Angry Coder
04-26-2006, 05:51 PM
Hello there,

I am using this script from Dynamic Drive:

http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm

It's working fine but I want a little modification to make the drop down menu appears from the right side, not from the left.

An image is attached within the post to clarify what I exactly failed to accomplish :(

Your help would be greatly appreciated.

ddadmin
04-27-2006, 04:13 AM
Inside anylink.js, locate the line:


dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"

and change that to:


dropmenuobj.style.left=dropmenuobj.x-(dropmenuobj.offsetWidth-obj.offsetWidth)+"px"

That should do it.

Angry Coder
04-27-2006, 04:02 PM
MANY THANKS. That's exactly what I need :)

Can you tell me how can I center it, please?

alMubarmij
04-28-2006, 01:38 AM
Good.

Is it will compatible with RTL (Right to Left) ?

I mean when we use <html dir="rtl"> or <div dir="rtl">..

Thanks.

Angry Coder
04-28-2006, 02:35 AM
Yep. ;)

alMubarmij
04-28-2006, 10:59 AM
How to ?
Please modify script for that.

Angry Coder
04-28-2006, 04:21 PM
Just add: <html dir="rtl"> and...

Inside anylink.js, locate the line:


dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"

and change that to:


dropmenuobj.style.left=dropmenuobj.x-(dropmenuobj.offsetWidth-obj.offsetWidth)+"px"

Angry Coder
06-12-2009, 03:54 AM
Hi ddadmin,

I don't know whether you're still alive or not after all those years but I need your help again.

This line doesn't exist in the new version:

dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"

Please help, again.

ddadmin
06-12-2009, 07:59 AM
To do the same in v2.x of the script, try finding the below lines inside the .js file:


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

and change that to just:


posx=posx-this.dimensions.dropmenuw + (menu.orientation=="lr"? -this.dimensions.anchorw : this.dimensions.anchorw)

Angry Coder
06-12-2009, 01:24 PM
It worked. Thank you so much.

alMubarmij
06-13-2009, 05:52 AM
Thank You.

AngryCoder: Ma Badry Ya Ustaz !