Created
February 24, 2016 07:37
-
-
Save Scretch-1/fa5ffa847b7bf35ec7a3 to your computer and use it in GitHub Desktop.
jQ Добавление CSS стилей при наведении, изменение стилей при отведении.
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
//Добавление стилей при наведении, изменение стилей при отведении. | |
//Пример:<p>Move the mouse over a paragraph.</p> <p>Like this one or the one above.</p> | |
//Документация http://api.jquery.com/css/ | |
$( "p" ) | |
.on( "mouseenter", function() { | |
$( this ).css({ | |
"background-color": "yellow", | |
"font-weight": "bolder" | |
}); | |
}) | |
.on( "mouseleave", function() { | |
var styles = { | |
backgroundColor : "#ddd", | |
fontWeight: "bolder" | |
}; | |
$( this ).css( styles ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment