Results 1 to 2 of 2

Thread: ddsmoothmenu onclick collapse and expand

  1. #1
    Join Date
    Oct 2010
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default ddsmoothmenu onclick collapse and expand

    1) Script Title: ddsmoothmenu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...moothmenu.htm#

    3) Describe problem:
    I've done a search and didn't find exactly what I'm looking for. I'm using the ddsmoothmenu (vertical orientation) on a site and the client now wants to have the top level menu items collapse and expand on click rather than on hover. There are only a few instances where there is a dropdown...and those instances only have one sublevel.

    I've spent a TON of time styling the menu(s) with CSS and so I really don't want to have to start all over with another script just to add the (hopefully) simple functionality.

    Please let me know if more info is needed for a proper answer.

    Thanks!
    Casey
    Last edited by textile; 10-05-2010 at 08:42 PM.

  2. #2
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know this is old but here's a partial answer for anyone wanting the same thing. I only wanted the 'close on click' functionality.

    I'm using jQuery on my page and here's the relevant part of the code...

    Code:
    <script type="text/javascript">
    $(document).ready(function() {
         $('.ddsmoothmenu a').click(function(){
    	//...
    	   $("#smoothmenu1").find("ul").find("li").mouseleave();
            //...
    });
    </script>
    This catches any <a> tag within the div id of 'smoothemenu1' and will give you the close menu animation as if your mouse moved off the menu.

    Hope that makes sense!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •