jQuery implementation switching hidden and display simultaneous switch icon function

    jq hidden display icon switched         Here is the content to display or hide   
JS code:

$ (Document) .ready (function () {// Get an element Click event by id = "CTR" $ ("# ctr"). click (function () {// puts the display and hidden display icon path in both states VAR images = ['./ iMages / 01.jpg', '. / Images / 02.jpg ']; // By the value of the Class to determine the icon style IF ($ ("# ctr") of the control display. Attr ("class) ==" Down ") {$ (" # Ctr " ) .attr ("src", images [0]); $ ("# Ctr"). RemoveClass ();} else {$ ("# ctr"). Attr ("src", images [1]); $ ("#ctr"). Addclass ("Down");} // Hidden or display of the control element Toggle (), 300 is the speed of control elements or hidden speed $ ("# info"). Toggle 300);});});
The above is to achieve approximate processes of hidden / display effects, because I am in someone who is in a certain place, please bear with me. If everyoneIf you have any questions, please give me a message, the small package will reply to everyone in time!

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment