gpt4 book ai didi

javascript - Html、Javascript 或 Css 云滑动

转载 作者:行者123 更新时间:2023-11-27 23:54:22 28 4
gpt4 key购买 nike

<分区>

我正在尝试在此页面上创建类似于云的幻灯片效果:http://www.poweredwebsite.com/index-v.php

使用 javascript (JQuery)、css 或 html。我当前的代码不工作(我使用的是 Chrome)

<html>
<head>
<style type="text/css">
.container {
position: absolute;
width: 300px;
height: 300px;
overflow: hidden;
}

.images-container {
position: absolute;
padding: 0;
margin: 0;
}
</style>
<script src="jquery.js"></script>
<script>
function animate() {
$(".scroll-image").animate({ "left": "+=500px" }, 3000, "linear",
function () {
$(this).css({ "left": "-=500px" });
animate();
});
}

animate();
</script>
</head>
<body>
<div class="container">
<span class="images-container">
<span class="scroll-image" style="left: -500px">
<img src="http://www.startextures.com/starnetblog/wp-content/uploads/2011/01/starnetblog_seamless_hazard_danger_texture4.jpg" width="500px">
</span>
<span class="scroll-image" style="left: 0px">
<img src="http://www.startextures.com/starnetblog/wp-content/uploads/2011/01/starnetblog_seamless_hazard_danger_texture4.jpg" width="500px">
</span>
</span>
</div>
</body>
</html>

有什么帮助吗?

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com