Last active
October 11, 2018 11:01
-
-
Save Scretch-1/7bdb0c6bf606d92d5bee to your computer and use it in GitHub Desktop.
jQ Добавление, удаление класса (наведение, клик)
This file contains hidden or 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
//Добавление класса при наведении, при клике присваивает класс (mouseenter (.addClass)) при повторном клике убирает класс (mouseleave(.removeClass)) | |
//Пример: <div class="test">test div</div> | |
//Документация: http://api.jquery.com/on/ | |
$( "div.test" ).on({ | |
click: function() { | |
$( this ).toggleClass( "activation" 50 ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment