$('iframe')。ready()方法在jQuery中如何工作?
这是一个示例,其中iframe的大小大于页面的大小。每当使用jQuery加载iframe时,我们都会滚动到页面顶部-
示例
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$('iframe').ready(function(){
$(window).scrollTop(0);
});
});
});
</script>
</head>
<body>
<iframe frameborder="2" height="900" id="iframe" align="top" src="https://www.qries.com" width="900" ></iframe><br>
<button>Loop through each image</button>
</body>
</html>热门推荐
10 蛋糕班级新年祝福语简短
11 八一祝福语简短文字
12 七十年祝福语简短
13 生日毕业祝福语简短英文
14 长辈生日祝福语简短大全
15 如果不结婚祝福语简短
16 爸爸生日简单祝福语简短
17 买车新年祝福语简短创意
18 元旦感恩祝福语简短大全