課程
/前端開(kāi)發(fā)
/JavaScript
/Tab選項(xiàng)卡切換效果
哈哈,雖然我比計(jì)較笨,但是還是靠自己百度和理解解決問(wèn)題啦!
2014-11-27
源自:Tab選項(xiàng)卡切換效果 4-1
正在回答
var?wrap?=?document.getElementById('wrap'), pic?=?document.getElementById('pic'), list?=?document.getElementById('list').getElementsByTagName('li'), index?=?0, timer?=?null; var?alength?=?list.length; var?piclist?=?pic.getElementsByTagName('li'); timer?=?setInterval(autoplay,?1000); for?(var?i?=?0;?i?<?alength;?i++)?{ list[i].aa?=?i; list[i].onmouseover?=?function()?{ clearInterval(timer); var?thisid?=?this.aa; showpic(thisid); }; list[i].onmouseout?=?function()?{ timer?=?setInterval(autoplay,?1000); } } function?autoplay()?{ index++; if?(index?>=?alength)?{ index?=?0; } showpic(index); } function?showpic(curindex)?{ if?(curindex?>?alength)?{ curindex?=?0; } for?(var?i?=?0;?i?<?alength;?i++)?{ list[i].className?=?"?"; piclist[i].style.display?=?"none"; } list[curindex].className?=?"on"; piclist[curindex].style.display?=?"block"; index?=?curindex; }
舉報(bào)
本課程詳細(xì)介紹網(wǎng)頁(yè)頁(yè)面中最流行常用的tab切換效果
1 回答完美測(cè)試成功
1 回答OK學(xué)會(huì)啦
5 回答完美實(shí)現(xiàn)、、、
1 回答完整代碼!
3 回答完整代碼!
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2014-12-12