更新时间:2023-11-21 10:38:40
请尝试
$(window).on("load", function() {
// your logic here.
});
而不是
$(document).ready(function(){...});
注意 - 在加载所有资产(包括图像)时调用load。当DOM准备好进行交互时,就会触发就绪。
Note - load is called when all assets are done loading, including images. ready is fired when the DOM is ready for interaction.