PDA

View Full Version : How to modify - All levels navigation menu



boppzoli
03-24-2014, 10:41 PM
Script: All levels navigation menu
http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/index.htm

Hi,
I would like to ask, if it is possible that a submenu to be slide from right to left, not left to right?
I hope you understand my question ...
Sorry for my english :o
Thank you in advance!

Beverleyh
03-25-2014, 08:14 AM
Its easy enough to make the menus always flyout from right to left - this is just a code fragment due to the length of the script and post character limit, but locate the 2 lines in red in your own js file, and comment them out (or delete them). There will be no slide effect though as that would need a rewrite.




...

//Sub menu starting left position
var menuleft=(this._istoplevel? this._offsets.left + (dir=="sidebar"? this._dimensions.w : 0) : this._dimensions.w)
// comment out this line if (submenurightedge-scrollX>ddlevelsmenu.docwidth){
menuleft+= -this._dimensions.submenuw + (this._istoplevel && dir=="topbar" ? this._dimensions.w : -this._dimensions.w)
// comment out this line }
submenu.parentNode.style.left=menuleft+"px"
//Sub menu starting top position
var menutop=(this._istoplevel? this._offsets.top + (dir=="sidebar"? 0 : this._dimensions.h) : this.offsetTop)
if (submenubottomedge-scrollY>ddlevelsmenu.docheight){ //no room downwards?
if (this._dimensions.submenuh<this._offsets.top+(dir=="sidebar"? this._dimensions.h : 0)-scrollY){ //move up?
menutop+= - this._dimensions.submenuh + (this._istoplevel && dir=="topbar"? -this._dimensions.h : this._dimensions.h)
}
else{ //top of window edge
menutop+= -(this._offsets.top-scrollY) + (this._istoplevel && dir=="topbar"? -this._dimensions.h : 0)
}
}

...

boppzoli
03-25-2014, 06:53 PM
Oooo, yes!
Thank you very much Beverleyh!
It is exactly what I wanted !!! :)

boppzoli
03-25-2014, 07:36 PM
Hi, I have an another question, too ...
How can I display the arrow (arrow-right.gif image) in the left side of the submenus?
Is this possible, too?
Thank you again!

Beverleyh
03-25-2014, 08:31 PM
I can't test as I'm on iPhone at the mo but have a look in the ddlevelsmenu-base.css file, at the .rightarrowpointer definitions, and play around with the positioning. Maybe change left:100px; to margin-left:-135px; (a negative value to pull it over to the left) - higher or lower depending on the width of your button. Also replace the arrow image with one that points the other way for best effect ;)

boppzoli
03-26-2014, 12:40 PM
Hi,
It works! :)
I mirrored the arrow-right.gif image and now it's perfect! :)
Thanks, again! :)

Beverleyh
03-26-2014, 05:42 PM
no problem :)