0

我有幻灯片......

        <script type="text/javascript">
    <!--
    var image1=new Image()
    image1.src="slide-image-1.png"
    var image2=new Image()
    image2.src="slide-image-2.png"

    //-->
    </script>

<img name="slide" class="image1" src="slide-image-1.png" />
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<2)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",4000)
}
slideit()
//-->
</script>

我想通过从右到左水平滚动来改变幻灯片相互替换的方式(我希望这是有道理的)。请问这种类型的转换叫什么?可以通过简单的几行来完成吗?

(我知道这对于经验丰富的网页设计师来说可能是一件容易的事情,但我才刚刚开始,不确定这会是什么)

4

2 回答 2

1

您可以使用 jQuery 来执行此操作。您可以在此处找到许多插件。

于 2012-06-29T19:18:22.953 回答
0

你可以简单地使用 jquery 来获得这样的效果我为两个 div 的动画添加了伪代码

<body>
    <div id="divone" style="background-color:#808080;width:150px;height:250px;"></div>
    <div id="div1" style="background-color:#0026ff;width:150px;height:250px;display:none;"></div>
    <script>
        //jQuery("#divone").animate({ opacity: 0.10 }, 5000);
        //jQuery("#divone").fadeOut(5000);
        jQuery("#divone").fadeOut(5000, function () { jQuery("#div1").fadeIn(5000) })
    </script>
</body>
于 2012-06-29T19:36:29.067 回答