?? trends.js
字號:
function scrollNews(selector,Entry,time,StartIndex)
{
var _self=this;
this.Selector=selector;
this.Entry=Entry;
this.time = time;
this.i=StartIndex||0;
this.Count=$(this.Selector+" ul li").length;
$(this.Selector+" ul li").hide();//全部隱藏
$(this.Selector+" ul li").eq(this.i).show();//第i個顯示
$(this.Selector).bind("mouseenter",function(){
if(_self.sI){clearInterval(_self.sI);}
}).bind("mouseleave",function(){
_self.showIndex(_self.i++);
})
this.sI=setInterval(this.Entry+".showIndex(null)",this.time);
this.GetSelector=function(){return this.Selector;}
this.showIndex=function(index)
{
this.i++;//顯示下一個
if(this.sI){clearInterval(this.sI);}
this.sI=setInterval(this.Entry+".showIndex()",this.time);
if (index!=null)
{
this.i=index;
}
if(this.i==this.Count)
this.i=0;
$(this.Selector+" ul li").hide();
$(this.Selector+" ul li").eq(this.i).slideDown();
}
}
/**滾動新聞展示效果
code by CssRain--橘子.
轉載請注明:http://www.cssrain.cn
// 參數1:ID
// 參數2:實例化對象的名稱(跟var 后的相同)
// 參數3:間隔時間
// 參數4:初始化時,默認哪個先顯示
**/
var s=new scrollNews("#trends","s", 3000 , 3);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -