手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

jQuery鼠标滚动全屏3D翻转动画切换

时间:2024-10-26 12:30:23

1、新建html文档。

jQuery鼠标滚动全屏3D翻转动画切换

2、书写hmtl代艨位雅剖码。<div id="cubeTransition">媪青怍牙<div class="page1"> <h2>cubeTransition.js</h2></div><div class="page2"> <h2 style='display:none'>Elegant,</h2></div><div class="page3"> <h2 style='position:absolute;left:0px;top:-150px'>exected!</h2></div><div class="page4"> <h2>Simple.</h2></div></div><ul id="bullets"></ul><div class="credit">ansition.js</div>

jQuery鼠标滚动全屏3D翻转动画切换

3、书写css代码。<style>.page4 h2 { margin: auto !important; position: absolute !important; top: 0 !important; left: 0; bottom: 0; right: 0; height: 100px; transform: none; transition: all 3s; }.ani { transform: scale(3) rotate(360deg) !important; }</style>

jQuery鼠标滚动全屏3D翻转动画切换

4、书写并添加js代码。<script>function animationIn(i){console.log(i,'i\'m in')switch(i) { case 1: $('.page2 h2').fadeIn(); break; case 2: $('.page3 h2').animate({top:'40%',left:'30%'},1000); break; case 3: setTimeout(function(){ $('.page4 h2').addClass('ani') console.log('hhh') },0) break; default: ;}}function animationOut(i){console.log(i,'i\'m out')switch(i) { case 1: $('.page2 h2').fadeOut(); break; case 2: $('.page3 h2').animate({top:0,left:0},1000); break; case 3: $('.page4 h2').removeClass('ani') break; default: ;}}</script><script src='js/mousewheel.js'></script><script src="js/jquery.touchSwipe.js"></script><script src="js/cubeTransition.js"></script>

jQuery鼠标滚动全屏3D翻转动画切换

5、代码整体结构。

jQuery鼠标滚动全屏3D翻转动画切换

6、查看效果。

jQuery鼠标滚动全屏3D翻转动画切换
© 手抄报圈