Skip to content

Instantly share code, notes, and snippets.

@Scretch-1
Created February 24, 2016 07:37
Show Gist options
  • Save Scretch-1/fa5ffa847b7bf35ec7a3 to your computer and use it in GitHub Desktop.
Save Scretch-1/fa5ffa847b7bf35ec7a3 to your computer and use it in GitHub Desktop.
jQ Добавление CSS стилей при наведении, изменение стилей при отведении.
//Добавление стилей при наведении, изменение стилей при отведении.
//Пример:<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