Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这样的标记:
<body onLoad="func();" onResize="func();" id="myId">
我想知道如何仅通过 jQuery 触发它?
$( "body" ).on( "load resize", func ); $( "body" ).trigger( "resize" );
$(function() { $(window).on('resize', func); func(); });
$('body').bind('load resize', func);