Javascript 加载带有图像的html文件后运行Jquery脚本
以下是我的代码: 索引文件:Javascript 加载带有图像的html文件后运行Jquery脚本,javascript,jquery,html,image,Javascript,Jquery,Html,Image,以下是我的代码: 索引文件: <div class="other">other images</div> <div class="fotos"> <?php include ('images.html'); ?> </div> images.html: <img src="image1.jpg"></img> <img src="image2.jpg"></img> <img s
<div class="other">other images</div>
<div class="fotos">
<?php include ('images.html'); ?>
</div>
images.html:
<img src="image1.jpg"></img>
<img src="image2.jpg"></img>
<img src="image3.jpg"></img>
<img src="image4.jpg"></img>
<img src="image5.jpg"></img>
问题是:脚本“center.js”必须在加载所有图像后运行。
有人能帮忙吗
thanx,gr Tim向
将它放在所有代码下面。例如,在最后添加脚本。控制台上是否有任何错误。请在页面加载$('.other')之前加载它。单击(function(){$.getScript(“javascript/center.js”);$('.fotos').Load('otherimages.html');});
<img src="image1.jpg"></img>
<img src="image2.jpg"></img>
<img src="image3.jpg"></img>
<img src="image4.jpg"></img>
<img src="image5.jpg"></img>
$('.other').click (function() {
$('.fotos').load('otherimages.html', function() {
$.getScript("javascript/center.js");
});
});