国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術(shù)文章
文章詳情頁

js+css實現(xiàn)扇形導(dǎo)航效果

瀏覽:70日期:2024-04-25 08:10:05

本文實例為大家分享了js+css實現(xiàn)扇形導(dǎo)航效果的具體代碼,供大家參考,具體內(nèi)容如下

<!DOCTYPE html><html> <head> <meta charset='utf-8'> <title>扇形導(dǎo)航</title> <style type='text/css'> *{ margin: 0; padding: 0; } html,body{ height: 100%; overflow: hidden; } #wrap{ height: 50px; width: 50px; /* background-color: pink; */ position: fixed; right: 15px; bottom: 15px; /* overflow: hidden; */ } #wrap>.home{ height: 49px; width: 49px; /* margin: auto; */ background: url(img/home.png) ; background-position: center; border-radius: 50%; transition: 1s; position: absolute; z-index: 1; } #wrap>.nav{ height: 100%; position: relative; } #wrap>.nav>img{ position: absolute ; right: 0px; bottom: 0px; margin: 4px; border-radius: 50% ; } .home:hover{ transform: rotate(360); } </style> </head> <body> <div id='wrap'> <div class='home'></div> <div class='nav'> <img src='http://www.cgvv.com.cn/bcjs/img/clos.png' > <img src='http://www.cgvv.com.cn/bcjs/img/full.png' > <img src='http://www.cgvv.com.cn/bcjs/img/open.png' > <img src='http://www.cgvv.com.cn/bcjs/img/prev.png' > <img src='http://www.cgvv.com.cn/bcjs/img/refresh.png' > </div> </div> </body> <script type='text/javascript'> window.onload =function(){ var homeEle = document.querySelector('#wrap>.home'); var flag= true; var imgs =document.querySelectorAll('#wrap>.nav>img'); function fn(){ this.style.transition=0.3+'s'; this.style.transform ='rotate(-360deg) scale(1)'; this.style.opacity =1; this.removeEventListener('transitionend',fn); } for (var i=0;i<imgs.length;i++) { imgs[i].onclick =function(){ this.style.transform ='rotate(-360deg) scale(2)'; this.style.transition ='0.3s'; this.style.opacity =0.1; this.addEventListener('transitionend',fn); } } homeEle.onclick =function(){ console.log(imgs.length); if(flag){ this.style.transform='rotate(-720deg) '; imgs.forEach((index,No)=>{ imgs[No].style.right = getLocation(140,No*22.5/180*Math.PI).left+'px'; imgs[No].style.bottom = getLocation(140,No*22.5/180*Math.PI).top+'px'; imgs[No].style.transform ='rotate(-360deg) scale(1)'; imgs[No].style.transition ='1s '+No*0.1+'s'; }); }else{ this.style.transform='rotate(0)'; imgs.forEach((index,No)=>{ imgs[No].style.right = 0+'px'; imgs[No].style.bottom = 0+'px'; imgs[No].style.transform ='rotate(0deg) scale(1)'; imgs[No].style.transition='1s '+(0.4-No*0.1)+'s'; }); } flag =!flag; } var getLocation =function(r,deg){ var x =Math.round(r*Math.sin(deg)); var y =Math.round(r*Math.cos(deg)); return{left:x,top:y}; } } </script></html>

js+css實現(xiàn)扇形導(dǎo)航效果

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: JavaScript
相關(guān)文章:
主站蜘蛛池模板: 亚洲精品国产啊女成拍色拍 | 一级做a免费视频观看网站 一级做a爰 | 国产成人99久久亚洲综合精品 | 亚洲第一网站在线观看 | 刺激免费视频 | 妖精www成人动漫在线观看 | a级毛片免费观看在线播放 a级毛片免费看 | 国产精品免费aⅴ片在线观看 | 亚洲男人网 | 免费高清一级欧美片在线观看 | 99久久伊人一区二区yy5o99 | 亚洲成人精品久久 | 三级毛片网站 | 2019在线亚洲成年视频网站 | 久久国产精品永久免费网站 | 99re热精品视频国产免费 | 午夜黄色毛片 | 国产成人精品午夜 | 久久精品中文字幕免费 | 国产精品成久久久久三级 | 国产精品一区亚洲一区天堂 | 真实偷清晰对白在线视频 | 成人毛片网 | 国产成人禁片免费观看视频 | 精品一区二区三区在线播放 | 亚洲成a人 | 美女福利视频国产片 | 国产伦码精品一区二区 | 成人18免费观看的软件 | 欧美午夜网站 | 成人a毛片在线看免费全部播放 | 精品免费久久久久久久 | 欧美人成片免费看视频不卡 | 国产片一级片 | 中国a级黄色片 | 99久在线精品99re6视频 | 成人性版蝴蝶影院污 | 黄色福利小视频 | 中文字幕在线观看一区 | 毛片在线高清免费观看 | 欧美一级毛片在线看视频 |