仿淘寶首頁上下滾動廣告特效
來源:易賢網(wǎng) 閱讀:1236 次 日期:2016-06-14 10:44:28
溫馨提示:易賢網(wǎng)小編為您整理了“仿淘寶首頁上下滾動廣告特效”,方便廣大網(wǎng)友查閱!

有網(wǎng)友通過qq群想做一個淘寶首頁的上下翻動的特效。通過火狐的firebug查看是通過層的隱藏和定位來實(shí)現(xiàn)的。

我共用了淘寶的內(nèi)容,然后通過jquery操作對其進(jìn)行特效實(shí)施。

查看特效:仿淘寶首頁上下滾動廣告特效

代碼如下:

jquery代碼

<script language=javascript>

<!--

$(function(){

var $t=math.floor(math.random()*3); //隨機(jī)產(chǎn)生一個1-3數(shù)字 默認(rèn)顯示第幾個

$(#upc).click(function(){//向上點(diǎn)擊

$t++;if($t>=2){$t=2;$(this).addclass(disable);};

$(#rollcontent).animate({top:-194*$t});

$(#downc).removeclass(disable);

$(#numshow > em).text($t*3+-+($t+1)*3);

});

$(#downc).click(function(){//向下點(diǎn)擊

$t--;if($t<=0){$t=0;$(this).addclass(disable);}

$(#rollcontent).animate({top:-194*$t});

$(#upc).removeclass(disable);

$(#numshow>em).text($t*3+1+-+($t+1)*3);

});

$(#numshow>em).text($t*3+1+-+($t+1)*3);

if($t==0)$(#downc).addclass(disable);

if($t==2)$(#upc).addclass(disable);

$(#rollcontent).animate({top:-194*$t});

});

-->

</script>

以上就是代碼嘍!

更多信息請查看腳本欄目
易賢網(wǎng)手機(jī)網(wǎng)站地址:仿淘寶首頁上下滾動廣告特效
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機(jī)站點(diǎn)

版權(quán)所有:易賢網(wǎng)