我使用下面的http://tympanus.net/Development/AnimatedResponsiveImageGrid/index3.html来显示图像网格。主要目的是通过淡入随机交换图像。
唯一的缺点是没有加载效果,我觉得如果拇指可以在http://thecodeplayer.com/walkthrough/grid-animation-effects中动画它会很酷,风暴效应在第二部分将是理想的,即使是第一个会做。
或者,最好的方法是使用后一个脚本,然后围绕着添加随机图像淡入来发挥作用吗?
发布于 2015-03-12 06:55:13
您需要在包含jquery.*.js之后添加jquery.*.js。
然后编写下面的代码
$(document).ready(function(){
$("img").each(function(){
d = Math.random()*1000;
$(this).delay(d).animate({opacity: 1}, {
step: function(n){
//rotating the images on the Y axis from 360deg to 0deg
ry = (1-n)*360;
//translating the images from 1000px to 0px
tz = (1-n)*1000;
//applying the transformation
$(this).css("transform", "rotateY("+ry+"deg) translateZ("+tz+"px)");
},
duration: 3000,
//some easing fun. Comes from the jquery easing plugin.
easing: 'easeOutQuint',
})
})
});
https://stackoverflow.com/questions/29003281
复制相似问题