站长资源网页制作

html5菜单折纸效果

整理:jimmy2025/1/11浏览2
简介类似猎豹浏览器安装时的用户须知效果。点击后效果复制代码代码如下: fold paper</div> <div class="news_infos"><div id="MyContent"><p>类似猎豹浏览器安装时的用户须知效果。<br><br><a href="javascript:;" onclick="showimg('/UploadFiles/2021-03-30/20140422164631.jpg?2014322164842');"><img src="/UploadFiles/2021-03-30/20140422164631.jpg?2014322164842" alt="html5菜单折纸效果" onmousewheel="return bbimg(this)" onload="javascript:resizepic(this)" border="0"/></a></p> 点击后效果 <p><a href="javascript:;" onclick="showimg('/UploadFiles/2021-03-30/20140422164644.jpg?201432216493');"><img src="/UploadFiles/2021-03-30/20140422164644.jpg?201432216493" alt="html5菜单折纸效果" onmousewheel="return bbimg(this)" onload="javascript:resizepic(this)" border="0"/></a><br><br><u>复制代码</u>代码如下:<br><!DOCTYPE html><br><html><br> <head><br> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><br> <title>fold paper effect by gt-柯乐义</title><br> <style><br>#wrapper {<br> -webkit-perspective: 55cm;<br> -webkit-perspective-origin: 50% 50%;<br> text-align: center;<br>}<br>.paper {<br> position: relative;<br> height: 40px;<br> width: 5em;<br> margin: 0;<br> background-color: aqua;<br> -webkit-transition: -webkit-transform 1s linear;<br>}<br></style><br> <script type="text/javascript"><br> window.angel = 0;<br> window.timer;<br> function fold() {<br> var foldUp = document.getElementById("foldUp");<br> var foldDown = document.getElementById("foldDown");<br> var down = document.getElementById("down");<br> if (window.angel == 0) {<br> window.timer = setInterval(function() {<br> var diff = different(-1, 20);<br> console.log(foldUp.offsetTop)<br> move(foldUp, diff, 1);<br> move(foldDown, diff, 3);<br> move(down, diff, 4);<br> }, 40);<br> setTimeout(function() {<br> clearInterval(window.timer);<br> foldUp.style.top = "-20px";<br> foldDown.style.top = "-60px";<br> down.style.top = "-80px";<br> window.angel = -90;<br> }, 1030);<br> foldUp.style.webkitTransform = "rotateX(-90deg)";<br> foldDown.style.webkitTransform = "rotateX(90deg)";<br> } else if (angel == -90) {<br> window.timer = setInterval(function() {<br> var diff = different(1, 20);<br> console.log(foldUp.offsetTop)<br> move(foldUp, diff, 1);<br> move(foldDown, diff, 3);<br> move(down, diff, 4);<br> }, 40);<br> setTimeout(function() {<br> clearInterval(window.timer);<br> foldUp.style.top = "0";<br> foldDown.style.top = "0";<br> down.style.top = "0";<br> window.angel = 0;<br> }, 1030);<br> foldUp.style.webkitTransform = "rotateX(0deg)";<br> foldDown.style.webkitTransform = "rotateX(0deg)";<br> } else {<br> console.log(window.angel)<br> }<br> }<br> function positionValue(div, type) {// 得到css带单位的值<br> var str = div.style[type];<br> str = str.substring(0, str.length - 2);<br> var value = parseInt(str);<br> if (isNaN(value)) {<br> value = 0;<br> }<br> return value;<br> }<br> function move(div, different, time) {<br> var top = positionValue(div, "top");<br> div.style.top = top + different * time + "px";<br> }<br> function different(direction, height) {<br> var lastAngel = window.angel;<br> window.angel += 3.6 * direction;<br> var different = Math<br> .ceil((Math.cos(window.angel / 180 * Math.PI) - Math<br> .cos(lastAngel / 180 * Math.PI))<br> * height * 100) / 100;<br> return different;<br> }<br></script><br> </head><br> <body><br> <div id="wrapper"><br> <div id="up" class="paper"><br> g<br> </div><br> <div id="foldUp" class="paper"><br> n<br> </div><br> <div id="foldDown" class="paper"><br> b<br> </div><br> <div id="down" class="paper"><br> t<br> </div><br> </div><br> <button onclick=fold();><br> fold<br> </button><br> </body><br></html><br></p></div> </div> </div> <div class="share"> </div> <div class="nextinfo"> <p>上一篇:<a href="http://m.paidiu.com/show/1/69487.html" title="HTML5添加鼠标悬浮音响效果不使用FLASH">HTML5添加鼠标悬浮音响效果不使用FLASH</a></p> <p>下一篇:<a href="http://m.paidiu.com/show/1/69489.html" title="html5读取本地文件示例代码">html5读取本地文件示例代码</a></p> </div> <div class="otherlink"> <h2>最新资源</h2> <ul> <li><a href="/show/1/619123.html" title="群星《奔赴!万人现场 第2期》[FLAC/分轨]">群星《奔赴!万人现场 第2期》[FLAC/分轨]</a></li> <li><a href="/show/1/619122.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/show/1/619121.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/show/1/619120.html" title="【古典音乐】詹姆斯·高威《季节》1993[WA">【古典音乐】詹姆斯·高威《季节》1993[WA</a></li> <li><a href="/show/1/619119.html" title="贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]">贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]</a></li> <li><a href="/show/1/619118.html" title="小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE">小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE</a></li> <li><a href="/show/1/619117.html" title="群星《欢迎来到我身边 电影原声专辑》[32">群星《欢迎来到我身边 电影原声专辑》[32</a></li> <li><a href="/show/1/619116.html" title="群星《欢迎来到我身边 电影原声专辑》[FL">群星《欢迎来到我身边 电影原声专辑》[FL</a></li> <li><a href="/show/1/619115.html" title="雷婷《梦里蓝天HQⅡ》 2023头版限量编号低">雷婷《梦里蓝天HQⅡ》 2023头版限量编号低</a></li> <li><a href="/show/1/619114.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="/show/1/603302.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> </article> <footer> <p style="font-size: 14px;">友情链接:<a href="http://www.imxmx.com/" title="杰晶网络" target="_blank">杰晶网络</a> <a href="http://www.ddrfans.com/" title="DDR爱好者之家" target="_blank">DDR爱好者之家</a> <a href="http://www.nqxw.com/" title="南强小屋" target="_blank">南强小屋</a> <a href="/" 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></p> <p>Design by <a href="http://m.paidiu.com">黑松山资源网</a> <a href="/">http://m.paidiu.com</a></p> </footer> <script src="/images/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>