View Full Version : DD Mega Menu position - Help Please
fcbinfo
05-09-2013, 09:57 PM
1) Script Title: DD Mega Menu
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddmegamenu.htm
3) Describe problem:
Hello.
There is anyway to use rel="cssdrivemenu[center]" or something like [-130px] instead of [left]
Thank you for help!
fcbinfo
05-10-2013, 04:26 AM
Solved...
Based on
this: http://www.dynamicdrive.com/forums/showthread.php?64223-DD-mega-menu-positioning
and
this: http://www.dynamicdrive.com/forums/showthread.php?63556-DD-Mega-Menu-Positioning
i did this:
Copy the first line and add second line with some modifications
var orienttoleft=/\[left\]/.test($anchor.attr('rel')) //check for rel="submenuid[left]" to indicate submenu should be left aligned
var orienttocuston=/\[custon\]/.test($anchor.attr('rel')) //check for rel="submenuid[custon]" to indicate submenu should be left aligned
And changed this:
$wrapper.css({visibility:'visible', left:offset.left-(orienttoleft? $wrapper.outerWidth()-$anchor.outerWidth()-ddmegamenu.wrapperoffset[0] : 0), top:offset.top+$anchor.outerHeight(), zIndex:++ddmegamenu.startzindex})
To this:
if (orienttocuston){
$wrapper.css({visibility:'visible', left:offset.left-(orienttoleft? $wrapper.outerWidth()-$anchor.outerWidth()-ddmegamenu.wrapperoffset[0] : 100), top:offset.top+$anchor.outerHeight(), zIndex:++ddmegamenu.startzindex})
} else {
$wrapper.css({visibility:'visible', left:offset.left-(orienttoleft? $wrapper.outerWidth()-$anchor.outerWidth()-ddmegamenu.wrapperoffset[0] : 0), top:offset.top+$anchor.outerHeight(), zIndex:++ddmegamenu.startzindex})
}
Where "100" is the pixels that i want to back to the left. Use negative numbers to move to the right.
And used on my page the code rel="nameofmenu[custon]"
Details: Im not JavaScript coder... im a php man! Its Logic of programming.
Thanks for djr33 moderator =)
Powered by vBulletin® Version 4.2.2 Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.