PDA

View Full Version : Smooth Navigational Menu - disable help?



fjaccarino
09-13-2011, 02:35 PM
1) Script Title:

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

3) Describe problem:
Is this a way to disable the smooth menu temporarily? I am attempting a popup window when a particular menu item is chosen but need the smooth menu to stop reacting to mouse over events. Is this possible?

Thanks in advance for any advice

Frank J

ddadmin
09-13-2011, 05:46 PM
Try adding the below function to the HEAD section of your page:


<script>

function togglemenu(menuid, action){
var $=jQuery
var $menu=$('#'+menuid)
if (action=='disable'){
$menu.find('ul:eq(0)').css({visibility:'hidden'})
}
else{
$menu.find('ul:eq(0)').css({visibility:'visible'})
}
}

</script>

It lets you "hide" the inner contents of a smooth menu on demand, essentially disabling it on demand. For example, the following two links when clicked on enables/disables the Smooth Menu with ID "#smoothmenu1":


<a href="javascript:togglemenu('smoothmenu1', 'disable')">Disable</a> | <a href="javascript:togglemenu('smoothmenu1', 'enable')">Enable</a>