jquery實線文字上下多行輪動

head頭部樣式的的引入javascript

<script src="js/jquery-3.4.1.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.SuperSlide.2.1.3.js" type="text/javascript" charset="utf-8"></script>css

HTML內容區域java

<div class="scrollDiv" id="s2">
<ul>
<li><a href="http://www.17sucai.com/">1 插件焦點圖片特效圖片淡隱淡現、圖片上下滾動、圖片左右滾動、選項卡</a></li>
<li><a href="http://www.17sucai.com/">2jquery 文字連續滾動 節奏感十足的齒輪式滾動圖片展現與文字內容特效展現</a></li>
<li><a href="http://www.17sucai.com/">3jquery cycle 循環幻燈片插件多功能幻燈片插件支持多種幻燈片特效</a></li>
<li><a href="http://www.17sucai.com/">4jquery輕量級進度條 progressbar 帶動畫顯示的進度過程的jquery進度條特效</a></li>
<li><a href="http://www.17sucai.com/">5jquery菜單特效 鼠標滑過菜單區域圖標和文本相似flash動畫酷炫移動展現</a></li>
<li><a href="http://www.17sucai.com/">6jquery 圖片切換 自動切換顯示隱藏show/hide帶左右按鈕與分頁索引按鈕控制圖片自動切換顯示隱藏show/hide</a></li>
<li><a href="http://www.17sucai.com/">7jquery圖片特效 slide banner焦點圖片切換圖片上下翻滾、圖片左右翻滾、圖片淡隱淡現3種圖片滾動特效</a></li>
<li><a href="http://www.17sucai.com/">8javascript jscolor colorpicker js顏色選擇器插件10多種調用顏色方法與取值</a></li>
<li><a href="http://www.17sucai.com/">10jquery 圖片切換 自動切換顯示隱藏show/hide帶左右按鈕與分頁索引按鈕控制圖片自動切換顯示隱藏show/hide</a></li>
<li><a href="http://www.17sucai.com/">11jquery圖片特效 slide banner焦點圖片切換圖片上下翻滾、圖片左右翻滾、圖片淡隱淡現3種圖片滾動特效</a></li>
<li><a href="http://www.17sucai.com/">12javascript jscolor colorpicker js顏色選擇器插件10多種調用顏色方法與取值</a></li>
</ul>
</div>jquery

 

jquery內容區域app

<script type="text/javascript" charset="utf-8">
//滾動插件
(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):3000; //滾動的時間間隔(毫秒)
if(line==0) line=1;
var upHeight=0-line*lineH;
//滾動函數
scrollUp=function(){
_this.animate({
marginTop:upHeight
},speed,function(){
for(i=1;i<=line;i++){
_this.find("li:first").appendTo(_this);
}
_this.css({marginTop:0});
});
}
//鼠標事件綁定
_this.hover(function(){
clearInterval(timerID);
},function(){
timerID=setInterval("scrollUp()",timer);
}).mouseout();
}
});
})(jQuery);

$(document).ready(function(){
$("#s2").Scroll({line:4,speed:500,timer:4000});
});
</script>ide

 

 

補充內容:函數

裏面須要的js文件放到了博客園文件當中動畫

相關文章
相關標籤/搜索