当前位置: 懒人建站 > JS代码 > 网页特效 >

滚动字幕代码_无缝水平滚动

这个滚动字幕代码网页特效,实现了无缝水平滚动的文字滚动代码。你可以改造出更多滚动字幕代码效果。
分享到:

代码说明:

这个滚动字幕代码网页特效实现了无缝水平滚动的文字滚动代码。你可以改造的更加强大。

部分 JS代码
var $ = function (id) {
return "string" == typeof id ? document.getElementById(id) : id;
};
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}
Object.extend = function(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
return destination;
}
function addEventHandler(oTarget, sEventType, fnHandler) {
if (oTarget.addEventListener) {
oTarget.addEventListener(sEventType, fnHandler, false);
} else if (oTarget.attachEvent) {
oTarget.attachEvent("on" + sEventType, fnHandler);
} else {
oTarget["on" + sEventType] = fnHandler;
}
};
var Scroller = Class.create();
Scroller.prototype = {
initialize: function(idScroller, idScrollMid, options) {
var oThis = this, oScroller = $(idScroller), oScrollMid = $(idScrollMid);
this.SetOptions(options);
this.Side = this.options.Side || ["up"];//方向
this.scroller = oScroller; //对象
this.speed = this.options.Speed; //速度
this.timer = null; //时间
this.pauseHeight = 0; //定高
this.pauseWidth = 0; //定宽
this.pause = 0; //定高(宽)
this.side = 0; //参数
//用于文字上下滚动代码
this.heightScroller = parseInt(oScroller.style.height) || oScroller.offsetHeight;
this.heightList = oScrollMid.offsetHeight;
//用于文字左右滚动代码
this.widthScroller = parseInt(oScroller.style.width) || oScroller.offsetWidth;
this.widthList = oScrollMid.offsetWidth;
 

来源:懒人建站|发布人:懒人建站|2010-06-21|热度:|收 藏|报 错


相关代码

懒人建站

登 录| 注 册
你也许会喜欢X 关闭↑返回顶部→相关代码/文章
收藏到: 百度搜藏 新浪微博 QQ空间 更多
香港免备案空间,一年80元,500M空间、免费送100M mysql数据库。香港新世界电讯机房,与万网香港空间同机房,懒人建站同服务器。点击这里给我发消息速度演示:jquery 特效