新知识点

toggleClasscss

$("button").click(function(){
$("p").toggleClass("main");
});oop

each中的 falsethis

Use return false to break out of each() loops(循环) early.spa

$( "div" ).each(function( index, element ) {
// element == this
$( element ).css( "backgroundColor", "yellow" );
if ( $( this ).is( "#stop" ) ) {
$( "span" ).text( "Stopped at div index #" + index );
return false;
}
});
相关文章
相关标签/搜索