Created
June 22, 2015 22:12
-
-
Save sealucky7/46b260a6903c36fd80b7 to your computer and use it in GitHub Desktop.
Добавление класса к элементу
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
<ul class="small_photo"> | |
<li><img class="active" src="img/img_thumb.png" alt="photo"/></li> | |
<li><img src="img/img_thumb1.jpg" alt="photo"/></li> | |
<li><img src="img/img_thumb.png" alt="photo"/></li> | |
<li><img src="img/img_thumb.png" alt="photo"/></li> | |
</ul> | |
$(".small_photo img").click(function() { | |
$(".small_photo img").removeClass("active"); | |
$(this).addClass("active"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment