【发布时间】:2012-08-07 11:42:09
【问题描述】:
我在网上搜索过,但没有找到与我所追求的完全匹配的任何东西。 我想使用滑动过渡来改变我的图像。就像可以在 Windows 8 预览版视频 (http://windows.microsoft.com/en-US/windows-8/release-preview) 中看到的一样,在最初的几秒钟内,平铺图像变为文本,然后变为其他内容。 这可以在 JQuery 中完成吗?还是有更好的办法?
谢谢。
编辑:我在这里找到了想要的效果:http://malsup.com/jquery/cycle/browser.html 在左侧的“scrollUp”选项下。但我一辈子都不能让它在我的页面上工作! 谁能指导我在以下脚本中提供的代码应该放在哪里?
<img id="img" src="link here">
<script>
function changeImage()
{
var img = document.getElementById("img");
img.src = images[x];
x++;
if(x >= images.length){
x = 0;
}
//fadeImg(img, 100, true);
setTimeout("changeImage()", 3000);
}
var images = new Array(),
x = 0;
images[0] = "link here";
images[1] = "link here";
images[2] = "link here";
setTimeout("changeImage()", 3000);
</script>
【问题讨论】:
-
看看PhotoSwipe你在哪里滑动图片
标签: javascript jquery image transition