有人会这么善良并且告诉我,为什么这个脚本只适用于Firefox而不适用于Chrome。 脚本:完成后应该是一个简单的照片库 谢谢你的帮助!!!
$(document).ready(function() {
function animate()
$( ".picture" ).delay( 2000 ).fadeTo( "slow" , 0.00, function() {
$( ".picture2" ).animate({ opacity: 1.00 }, "slow" );
$( ".picture2" ).delay( 2000 ).fadeTo( "slow" , 0.00, function() {
$( ".picture" ).animate({ opacity: 1.00 }, "slow" );
animate();
});
});
animate();
});
答案 0 :(得分:0)
这是漏洞html代码
<html>
<head>
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<title>Bilderreihe | unfertig</title>
<style type="text/css">
.picture {
position: absolute;
left: 50px;
margin-top: 5%;
margin-left: 30%;
}
.picture2 {
position: absolute;
left: 50px;
margin-top: 5%;
margin-left: 30%;
opacity: 0.0;
}
</style>
</head>
<body>
<div class="all">
<div class="picture">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQYtvxXpYfat_I3XYW8tWZ42KJIHR25DsOIgA6CdHVbOXJYHHvDZw" height="300" width="500">
</div>
<div class="picture2">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQTIJMikQdg1bqI9PBgD_gBZSTcBCSRvzEN_sj_ngu0TrVbOdtr" height="300" width="500">
</div>
<div class="picture3">
<img src="">
<button id="left">«</button>
<button id="right">»</button>
</div>
<script>
$(document).ready(function() {
function animate()
$( ".picture" ).delay( 2000 ).fadeTo( "slow" , 0.00, function() {
$( ".picture2" ).animate({ opacity: 1.00 }, "slow" );
$( ".picture2" ).delay( 2000 ).fadeTo( "slow" , 0.00, function() {
$( ".picture" ).animate({ opacity: 1.00 }, "slow" );
animate();
});
});
animate();
});
</script>
</body>
</html>