ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 解決中 / 已回 這個函數只能用一次 怎么做可以無限用 文字滾動的功能 2 0
POSCMS版本:

(function ($) {

$.fn.extend({

Scroll: function (opt,callback) {

//參數初始化

if (!opt) var opt = {};

var _this = this.eq(0).find("ul:first");

var lineH = _this.find("li:first").height(), //獲取行高

line = opt.line ? parseInt(opt.line, 10) : parseInt(this.height() / lineH, 10), //每次滾動的行數,默認為一屏,即父容器高度

speed = opt.speed ? parseInt(opt.speed, 10) : 500, //卷動速度,數值越大,速度越慢(毫秒)

timer = opt.timer ? parseInt(opt.timer, 10) : 2000; //滾動的時間間隔(毫秒)

if (line == 0) line = 1;

var upHeight = 0 - line * lineH;

var downHeight=line * lineH - 0;

//滾動函數

scrollUp = function () {

_this.animate(

{ marginTop: upHeight },

speed,

function () {

for (i = 1; i <= line; i++) {

_this.find("li:first").appendTo(_this);

}

_this.css({ marginTop: 0 });

}

);

},

//向下滾動函數

scrollDown = function () {

_this.animate(

{ marginTop: downHeight },//動畫展示css樣式

speed,

function () {

_this.find("li:last").prependTo(_this);

_this.css({ marginTop: 0 });

}

)

}

var timerID

//鼠標事件綁定

_this.hover(function () {

clearInterval(timerID);

}, function () {

timerID = setInterval("scrollDown()", timer);//這里調用向下或者向上滾動函數

}).mouseout();

}

})

})(jQuery);

$(document).ready(function () {

$("#news_l").Scroll({ line: 1, speed: 500, timer: 2000 });

});

<div id="news_l">

<ul>

<li><a href="">新聞1</a><span>2017-08-28</span> </li>

<li><a href="">新聞1</a><span>2017-08-28</span> </li>

<li><a href="">新聞1</a><span>2017-08-28</span> </li>

<li><a href="">新聞1</a><span>2017-08-28</span> </li>

<li><a href="">新聞1</a><span>2017-08-28</span> </li>

</ul>

</div>

#news_l{width:100%;height:250px;min-height:25px;line-height:50px;overflow:hidden}

#news_l ul{padding:0 10px}

#news_l li{padding:0 5px ;font-size: 14px; height:49px;border-bottom: 1px dashed #e0e0e0;}

#news_l li span{float: right;line-height: 50px; color:#666;font-size: 14px;}

#news_l li a{color: #666;}

解決方案