html - jQuery Effects - JQuery show and hide div on mouse click -


i have 1 script (show , hide div #id on click )and work fine need know how can change font color (click here) on click mean if hide (div class="menu") click here text color black / if show (div class="menu") click here text color color red

image more clarify

http://s18.postimg.org/5f9in18u1/image.jpg

div id="showmenu">click here</div> <div class="menu" style="display: none;"><ul><li>button1</li><li>button2</li><li>button3</li></ul></div> 

script below

$(document).ready(function() {     $('#showmenu').click(function() {             $('.menu').slidetoggle("fast");     }); }); 

demo / http://jsfiddle.net/apa2s/1/

all need toggleclass function. take @ fiddle

$(document).ready(function() {     $('#showmenu').click(function() {         $('.menu').slidetoggle( 'fast' );         $('#showmenu').toggleclass( 'color' );    }); }); 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -