首页 > IT职业 > IT生活 > 实现一个灯笼效果,实现了一个意想不到的效果。
width: 50px;
height: 50px;
}
@keyframes mysnow{
0% { bottom: 100%; opacity: 0; }
50% { opacity: 1; transform: rotateZ(720deg) rotateX(720deg) rotateY(720deg);}
100% { transform: rotateZ(0deg); opacity: 0; bottom: 0%;} }
.container { position: fixed; }
.pic { position: absolute; opacity: 0; animation: mysnow 5s;height: 90px; }



































<!--
-->
// var i = $(this).index();
$(this).css({'transform':'rotateY('+oDeg*i+'deg) translateZ(65px)'});
})
var ooDeg = 0;
var bb = 0; // var aa = 1;
setInterval(function(){
ooDeg+=oDeg;
if(ooDeg%360 == 0){
bb++;
console.log(bb)
$('.dll img').each(function(i){
// var i = $(this).index();
$(this).css({'opacity':'1','transform':'rotateX(-360deg) rotateY('+oDegi+'deg) translateZ(108px)'});
$('.dl img').each(function(i){
// var i = $(this).index();
$(this).css({'opacity':'0','transform':'rotateY(0deg) translateZ(0px)'});
})
})
if((ooDegbb)%720 == 0){
// aa++;
$('.dlll img').each(function(i){
// var i = $(this).index();
$(this).css({'opacity':'1','transform':'rotateX(-360deg) rotateY('+oDegi+'deg) translateZ(173px)'});
$('.dll img').each(function(i){
// var i = $(this).index();
$(this).css({'opacity':'0','transform':'rotateY(0deg) translateZ(0px)'});
})
})
if((ooDegbb)%1080 == 0){
$('.dl img').each(function(i){
// var i = $(this).index();
$(this).css({'opacity':'1','transform':'rotateX(-360deg) rotateY('+oDegi+'deg) translateZ(250px)'});
$('.dlll img').each(function(i){
// var i = $(this).index();
$(this).css({'opacity':'0','transform':'rotateY(0deg) translateZ(0px)'});
})
})
}
}
}
$(".dl").css({'transform':'rotateX(-10deg) rotateY('+ooDeg+'deg)'});
$(".dll").css({'transform':'rotateX(-10deg) rotateY('+ooDeg+'deg)'});
$(".dlll").css({'transform':'rotateX(-10deg) rotateY('+ooDeg+'deg)'});
},1000)
})
window.innerWidth;
var height=Math.random()*window.innerHeight;
var src = 'a-img/xh/xh-3.png';
snowFlow(left,height,src);
},500)
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4586/viewspace-2798114/ ,如需转载,请注明出处,否则将追究法律责任。