Last active
December 15, 2015 22:19
-
-
Save mikeyakymenko/5331981 to your computer and use it in GitHub Desktop.
jQuery для смены многих класов по клику.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(function(){ | |
$('.ex_sortlink2 a').click(function(){ | |
var state = this.className; | |
state = state.split('state'); | |
state = state[1]; | |
state = parseInt(state); | |
state = (state + 1) % 5; | |
this.className = "state" + state; | |
return false; | |
}); | |
}) | |
</script> | |
<div class="ex_sortlink2"> | |
<a href="" class="state0">Цвета</a> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment