首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >栅格动画效果

栅格动画效果
EN

Stack Overflow用户
提问于 2015-03-12 06:34:51
回答 1查看 1.3K关注 0票数 1

我使用下面的http://tympanus.net/Development/AnimatedResponsiveImageGrid/index3.html来显示图像网格。主要目的是通过淡入随机交换图像。

唯一的缺点是没有加载效果,我觉得如果拇指可以在http://thecodeplayer.com/walkthrough/grid-animation-effects中动画它会很酷,风暴效应在第二部分将是理想的,即使是第一个会做。

或者,最好的方法是使用后一个脚本,然后围绕着添加随机图像淡入来发挥作用吗?

EN

回答 1

Stack Overflow用户

发布于 2015-03-12 06:55:13

您需要在包含jquery.*.js之后添加jquery.*.js

然后编写下面的代码

代码语言:javascript
运行
复制
$(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', 
        })
    })
});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29003281

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档