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.
看这段代码:
$('#loader').show(); $.post( '/action.php', function( data ) { // do anything with data $('#loader').hide(); } );
加载器 DIV 有一个模拟加载状态的 GIF 图像,此代码运行良好,但 GIF 在等待数据时停止(调用后)...
我希望 gif 独立于执行中的其他代码移动..我希望你理解我的问题..
我相信您想要 jQuery 文档网站上的示例中列出的行为。
jQuery:ajax 启动
您可以使用 ajaxStop 事件处理程序隐藏图像。