站长资源网页制作

CSS3 2D模拟实现摩天轮旋转效果

整理:jimmy2025/1/11浏览2
简介先看效果图:由于上传的大小原因,只能录制成这种效果,原图是无限循环的转圈。代码: 模拟摩天轮动画</ti</div> <div class="news_infos"><div id="MyContent"><p>先看效果图:</p> <p><a href="javascript:;" onclick="showimg('/UploadFiles/2021-03-30/20161116170501695.gif?2016101617512');"><img src="/UploadFiles/2021-03-30/20161116170501695.gif?2016101617512" alt="CSS3 2D模拟实现摩天轮旋转效果" onmousewheel="return bbimg(this)" onload="javascript:resizepic(this)" border="0"/></a></p> <p>由于上传的大小原因,只能录制成这种效果,原图是无限循环的转圈。</p> <p>代码:</p> <div class="htmlcode"> <pre class="brush:xhtml;"><span style="font-size:18px;"><!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>模拟摩天轮动画</title> <style> *{margin:0;padding:0;} .image{width:80px;height:80px;} .image1{width:620px;height:620px;} .div1{position:relative;margin:10px auto;width:638px; animation:run 20s linear infinite; -webkit-animation:run 20s linear infinite; -moz-animation:run 20s linear infinite; -o-animation:run 20s linear infinite; } img:nth-child(2){ position:absolute;top:25px;left:270px;opacity:0.7; animation:run2 20s linear infinite; -webkit-animation:run2 20s linear infinite; -moz-animation:run2 20s linear infinite; -o-animation:run2 20s linear infinite; transform-origin:top center; -webkit-transform-origin:top center; -moz-transform-origin:top center; -o-transform-origin:top center; } img:nth-child(3){ position:absolute;top:580px;left:270px;opacity:0.7; animation:run2 20s linear infinite; -webkit-animation:run2 20s linear infinite; -moz-animation:run2 20s linear infinite; -o-animation:run2 20s linear infinite; transform-origin:top center; -webkit-transform-origin:top center; -moz-transform-origin:top center; -o-transform-origin:top center; } img:nth-child(4){ position:absolute;top:300px;left:550px;opacity:0.7; animation:run2 20s linear infinite; -webkit-animation:run2 20s linear infinite; -moz-animation:run2 20s linear infinite; -o-animation:run2 20s linear infinite; transform-origin:top center; -webkit-transform-origin:top center; -moz-transform-origin:top center; -o-transform-origin:top center; } img:nth-child(5){ position:absolute;top:300px;left:0px;opacity:0.7; animation:run2 20s linear infinite; -webkit-animation:run2 20s linear infinite; -moz-animation:run2 20s linear infinite; -o-animation:run2 20s linear infinite; transform-origin:top center; -webkit-transform-origin:top center; -moz-transform-origin:top center; -o-transform-origin:top center; } @keyframes run { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} } @-webkit-keyframes run { 0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(360deg)} } @-moz-keyframes run { 0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(360deg)} } @-o-keyframes run { 0%{-o-transform:rotate(0deg)} 100%{-o-transform:rotate(360deg)} } @keyframes run2 { 0%{transform:rotate(0deg)} 100%{transform:rotate(-360deg)} } @-webkit-keyframes run2 { 0%{-webkit-transform:rotate(0deg)} 100%{-webkit-transform:rotate(-360deg)} } @-moz-keyframes run2 { 0%{-moz-transform:rotate(0deg)} 100%{-moz-transform:rotate(-360deg)} } @-o-keyframes run2 { 0%{-o-transform:rotate(0deg)} 100%{-o-transform:rotate(-360deg)} } </style> </head> <body> <div class="div1"> <img src="1.png" class="image1"> <img src="1.jpg" class="image"> <img src="2.jpg" class="image"> <img src="3.jpg" class="image"> <img src="4.jpg" class="image"> </div> </body> </html></span></pre> </div> <p> 摩天轮原图:</p> <p><a href="javascript:;" onclick="showimg('/UploadFiles/2021-03-30/20161116170340660.jpg?2016101617356');"><img src="/UploadFiles/2021-03-30/20161116170340660.jpg?2016101617356" alt="CSS3 2D模拟实现摩天轮旋转效果" onmousewheel="return bbimg(this)" onload="javascript:resizepic(this)" border="0"/></a></p> <p><strong>注释:</strong>transform-origin 属性允许您改变被转换元素的位置。<br></p> <p>这个属性主要的作用就是选择一个位置,然后绕着这个位置旋转。<br></p> <p>以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。<br></p></div> </div> </div> <div class="share"> </div> <div class="nextinfo"> <p>上一篇:<a href="/3g/1/71317.html" title="CSS3常用的几种颜色渐变模式总结">CSS3常用的几种颜色渐变模式总结</a></p> <p>下一篇:<a href="/3g/1/71319.html" title="IE8下CSS3选择器nth-child() 不兼容问题的解决方法">IE8下CSS3选择器nth-child() 不兼容问题的解决方法</a></p> </div> <div class="otherlink"> <h2>最新资源</h2> <ul> <li><a href="/3g/1/623703.html" title="群星《奔赴!万人现场 第2期》[FLAC/分轨]">群星《奔赴!万人现场 第2期》[FLAC/分轨]</a></li> <li><a href="/3g/1/623702.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/3g/1/623701.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/3g/1/623700.html" title="【古典音乐】詹姆斯·高威《季节》1993[WA">【古典音乐】詹姆斯·高威《季节》1993[WA</a></li> <li><a href="/3g/1/623699.html" title="贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]">贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]</a></li> <li><a href="/3g/1/623698.html" title="小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE">小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE</a></li> <li><a href="/3g/1/623697.html" title="群星《欢迎来到我身边 电影原声专辑》[32">群星《欢迎来到我身边 电影原声专辑》[32</a></li> <li><a href="/3g/1/623696.html" title="群星《欢迎来到我身边 电影原声专辑》[FL">群星《欢迎来到我身边 电影原声专辑》[FL</a></li> <li><a href="/3g/1/623695.html" title="雷婷《梦里蓝天HQⅡ》 2023头版限量编号低">雷婷《梦里蓝天HQⅡ》 2023头版限量编号低</a></li> <li><a href="/3g/1/623694.html" title="群星《2024好听新歌42》AI调整音效【WAV分">群星《2024好听新歌42》AI调整音效【WAV分</a></li> </ul> </div> </div> <div class="sidebar"> <div class="cloud"><h2 class="hometitle">一句话新闻</h2><a href="/3G/1/604673.html"><ul>微软与英特尔等合作伙伴联合定义“AI PC”:键盘需配有Copilot物理按键<br><br>几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。<br>在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。</ul></a></div> </div> <div class="sidebar"> 友情链接:<a href="http://www.imxmx.com/" title="杰晶网络" target="_blank">杰晶网络</a> <a href="/" title="DDR爱好者之家" target="_blank">DDR爱好者之家</a> <a href="http://www.nqxw.com/" title="南强小屋" target="_blank">南强小屋</a> <a href="http://www.paidiu.com/" title="黑松山资源网" target="_blank">黑松山资源网</a> <a href="http://www.dyhadc.com/" title="白云城资源网" target="_blank">白云城资源网</a> <a href="/sitemap1.xml">站点地图</a> <a href="/sitemap.xml">SiteMap</a> </div> </article> <footer> <p>Design by <a href="http://m.ddrfans.com">DDR爱好者之家</a> <a href="http://m.ddrfans.com">http://m.ddrfans.com</a></p> </footer> <script src="/images3g/nav.js"></script> <script type="text/javascript"> jQuery.noConflict(); jQuery(function() { var elm = jQuery('#left_flow2'); var startPos = jQuery(elm).offset().top; jQuery.event.add(window, "scroll", function() { var p = jQuery(window).scrollTop(); jQuery(elm).css('position', ((p) > startPos) ? 'fixed' : ''); jQuery(elm).css('top', ((p) > startPos) ? '0' : ''); }); }); </script> </body> </html>