jQuery實(shí)現(xiàn)花式輪播之圣誕節(jié)禮物傳送效果
旋轉(zhuǎn)出發(fā),旋轉(zhuǎn)到達(dá)。鼠標(biāo)經(jīng)過(guò)停止,點(diǎn)擊拆禮物!
寫(xiě)的比較簡(jiǎn)單,喜歡點(diǎn)贊收藏哦。
請(qǐng)?jiān)诠雀璧雀甙姹緸g覽器打開(kāi)^-^
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>圣誕禮物傳送輪播</title> <style> html, body { height: 100%; margin: 0; padding: 0; } .cr{ width: 100%; position: relative; background: url("http://cdn.attach.qdfuns.com/notes/pics/201612/15/174106gbm3famm0piq62mm.png") no-repeat 0 0; -webkit-background-size: 100% 100%; background-size: 100% 100%; overflow: hidden; } .cr-l,.cr-r{ position: absolute; bottom:10%; width: 20.8%; height: 70%; z-index:100; } .cr-l img,.cr-r img{ width: 100%; position: absolute; top:50%; } .cr-l{ left: 0; } .cr-r{ right:0; } .cr-icon{ bottom: 15%; left:0; position: absolute; z-index: 1000; width: 100%; height: 70%; text-align: center; } .cr-icon img{ margin-right: 25px; width: 10%; vertical-align: top; position: absolute; bottom: 0; opacity: 1; transform:rotate(0deg); transition: all 1s; } .cr-icon img:first-child{ transform:rotate(-90deg); -webkit-transform:rotate(-90deg); opacity: 0; width: 0; } .cr-icon img:last-child{ transform:rotate(90deg); -webkit-transform:rotate(90deg); opacity: 0; width: 0; } </style> </head> <body> <div class="cr"> <div class="cr-l"><img src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103o5zx1pzh4x1ccpcb.png" alt=""/></div> <div class="cr-icon"> <div id="cr-icon"> <img style="left:5%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/> <img style="left:25%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/> <img style="left:45%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/> <img style="left:65%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/> <img style="left:85%" src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png" alt=""/> </div> </div> <div class="cr-r"><img src="http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103dz0uhvec7nbunqwc.png" alt=""/></div> </div> <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script> $(".cr-icon img").click(function(){ if($(this).attr("src") == "http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png"){ $(this).attr("src","http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103ciomobruzrkbhhs5.png"); }else{ $(this).attr("src","http://cdn.attach.qdfuns.com/notes/pics/201612/15/174103e22y4zbkhi47bi2w.png"); } }); $(function() { var end = document.body.clientWidth; var height = document.body.scrollHeight; $(".cr").css("height",height); function scrollLogo() { $("#cr-icon img").each(function () { var left = parseInt($(this).css("left")); left += end * 0.2; $(this).css("left", left + "px"); }); $("#cr-icon img:last").insertBefore($("#cr-icon img:first")).css("left", document.body.clientWidth * 0.05).fadeIn(); } setTimeout(scrollLogo,0); var scroll = setInterval(scrollLogo, 1500); $("#cr-icon img").mouseenter(function () { clearInterval(scroll); }); $("#cr-icon img").mouseleave(function () { scroll = setInterval(scrollLogo, 1500); }); }); </script> </body> </html>
效果圖如下所示:
以上所述是小編給大家介紹的jQuery實(shí)現(xiàn)花式輪播之圣誕節(jié)禮物傳送效果,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
jQuery漸變發(fā)光導(dǎo)航菜單的實(shí)例代碼
今天介紹一個(gè)jQuery漸變發(fā)光效果的導(dǎo)航菜單,這是一個(gè)簡(jiǎn)單的通過(guò)jQuery控制opacity實(shí)現(xiàn)的導(dǎo)航菜單。2013-03-03基于jQuery實(shí)現(xiàn)左右div自適應(yīng)高度完全相同的代碼
最近做前端設(shè)計(jì)時(shí)需要使左右兩個(gè)DIV高度自適應(yīng)。這其中的jquery代碼中的獲得高度用的clientHeight,介紹一下幾種不同的獲得方式以及他們的差別2012-08-08jQuery與getJson結(jié)合的用法實(shí)例
這篇文章主要介紹了jQuery與getJson結(jié)合的用法,實(shí)例分析了jquery解析json數(shù)據(jù)及數(shù)組遍歷的相關(guān)操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-08-08jQuery實(shí)現(xiàn)表頭固定效果的實(shí)例代碼
jQuery實(shí)現(xiàn)表頭固定效果的實(shí)例代碼,需要的朋友可以參考一下2013-05-05jquery $.each 和for怎么跳出循環(huán)終止本次循環(huán)
如何在jquery 中的循環(huán)中終止本次循環(huán)或者跳出循環(huán)呢?經(jīng)搜索發(fā)現(xiàn)個(gè)不錯(cuò)的方法,大家不妨參考下,希望對(duì)大家有所幫助2013-09-09JQuery實(shí)現(xiàn)動(dòng)態(tài)適時(shí)改變字體顏色的方法
這篇文章主要介紹了JQuery實(shí)現(xiàn)動(dòng)態(tài)適時(shí)改變字體顏色的方法,實(shí)例分析了jQuery操作鼠標(biāo)事件及顏色的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-03-03jQuery實(shí)現(xiàn)下拉菜單動(dòng)態(tài)添加數(shù)據(jù)點(diǎn)擊滑出收起其他功能
這篇文章主要介紹了jQuery實(shí)現(xiàn)下拉菜單動(dòng)態(tài)添加數(shù)據(jù)點(diǎn)擊滑出收起其他功能,本文給大家介紹的非常詳細(xì),需要的朋友可以參考下2018-06-06jquery取子節(jié)點(diǎn)及當(dāng)前節(jié)點(diǎn)屬性值的方法
這篇文章主要介紹了jquery取子節(jié)點(diǎn)及當(dāng)前節(jié)點(diǎn)屬性值的方法,比較實(shí)用,需要的朋友可以參考下2014-09-09擴(kuò)展Jquery插件處理mouseover時(shí)內(nèi)部有子元素時(shí)發(fā)生樣式閃爍
在我們對(duì)一個(gè)dom添加mouseover和mouseout時(shí),也就是jquery的hover事件,如果該dom有子元素,鼠標(biāo)移到子元素時(shí)會(huì)觸發(fā)mouseout事件,但往往實(shí)際情況我們希望在子元素上不觸發(fā)out事件2011-12-12jQuery 擴(kuò)展對(duì)input的一些操作方法
擴(kuò)展對(duì)input的一些方法(練習(xí)jQuery插件)2009-10-10