Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-22-2008, 03:29 AM   PM User | #1
twodayslate
Senior Coder

 
twodayslate's Avatar
 
Join Date: Mar 2007
Location: VA
Posts: 1,042
Thanks: 67
Thanked 39 Times in 39 Posts
twodayslate is on a distinguished road
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!
twodayslate is offline   Reply With Quote
Old 11-22-2008, 06:51 PM   PM User | #2
twodayslate
Senior Coder

 
twodayslate's Avatar
 
Join Date: Mar 2007
Location: VA
Posts: 1,042
Thanks: 67
Thanked 39 Times in 39 Posts
twodayslate is on a distinguished road
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...
__________________
twitter | Quality Hosting - $5.95/mo*
Feel free to PM me!

Last edited by twodayslate; 11-22-2008 at 09:30 PM..
twodayslate is offline   Reply With Quote
Reply

Bookmarks

Tags
css, jquery, toggle

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:19 PM.


Advertisement
Log in to turn off these ads.