jquery[0] ---to be continued


$(window).resize(function()

javascript中(function()….)isclassicjQuery,isequalto(document).ready(function() {….}). That means this function will be executed after the html is loaded. This way is safer to deal with DOM after page is loaded.

(document).ready(function())==(function(){});


$(window).resize(function()

<script>
x=0;
$(document).ready(function(){
  $(window).resize(function(){
    $("span").text(x+=1);
  });
});
</script>

http://www.runoob.com/try/try.php?filename=tryjquery_event_resize

猜你喜欢

转载自blog.csdn.net/wondervictor/article/details/79239620