Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts

    Jquery toggle css

    Hello, just started jquery today.

    I have a menu that when an item is hovered a sub menu comes up. What I want is that when you click on the menu the submenu stays up.

    right now toggle sorta works but it does not stay up when I stop hovering over the item.

    Code:
    <script type="text/javascript">
    $(document).ready( function() 
    {
    	$('.m').click( function()
    	{
    		$('.m ul').toggle();
    	});
    
    });
    </script>
    http://avoki.com/

    thanks
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #2
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    fixed avoki so it actually toggles now.

    Do you understand what I am asking?

    edit:// a little closer http://stackoverflow.com/questions/3...image-rollover
    Code:
    $('.m ul').hide();
    
        	$('.m').bind("mouseenter", (function()
    	{
            	$('.m ul').hide()
         	}));
    	$('.m').click( function()
    	{
    		$('.m ul').toggle();
    	});
    but it does not stay up...
    Last edited by twodayslate; 11-22-2008 at 09:30 PM.
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!


  •  

    Tags for this Thread

    Posting Permissions

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