⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wed_scroll.js

📁 - 其中VIP源代码是经过测试
💻 JS
字号:
/************************************************************/
/* 文件名:wed_scroll.js										*/
/* 功能:文字卷动												*/
/* Author:小美 (mykg_1997@yahoo.com.cn)						*/
/* Copyright 2005 Xiaomei Studio All rights reserved.		*/
/************************************************************/

//////////////////////////////////文字上下运动变换
function txtmovein(x) {
x.style.color="#ff0000";
}
function txtmoveout(x) {
x.style.color="#874241";
}

var timer_1;
var waiting_time = 2000;
var scroll_time = 18;
var scroll_height = 20;	
var show_content_num = 4;

function WriteTableTop_1(n) {
	var str = "<div id='scroller"+n+"'  style='position: absolute; height:49; width:414; top:"+n*scroll_height*show_content_num+";'>";
	str += "<table border='0' cellpadding='0' cellspacing='1' width='414'>";
	return str;
}

function WriteTableBottom_1() {
	var str = "</table></div>";
	return str;
}

function WriteTableBody_1(n) {
	var str = "<tr height='"+(scroll_height-1)+"'>";
	str += "<td width='100%'><img src='images/icon_1.gif' align='absmiddle' hspace='6'><span style='color:#874241;cursor:default;' onmousemove='txtmovein(this)' onmouseout='txtmoveout(this)'>"+con_1[n][2]+"</span></td>";
	str += "</tr>";
	return str;
}

function WriteTable_1() {
	var str="";

	oScrollMain_1.style.height = scroll_height*show_content_num;

	str = WriteTableTop_1(0);
	for (var i=0; i < num_1; i++ ) {
		if ( i%show_content_num == 0 && i!=0)
		{
			str += WriteTableBottom_1();
			str += WriteTableTop_1(parseInt(i/show_content_num,14));
		}
		str += WriteTableBody_1(i);
	}
	str += WriteTableBottom_1();
	oScrollMain_1.innerHTML = str;
	mainFrame_1();
}

function mainFrame_1(){
	timer_1 = setTimeout("scrolling_1()", waiting_time);
}

function mainFrame2_1(){
	timer_1 = setTimeout("scrolling_1()", 1);
}

function scrolling_1() {
	var obj_1;
	for (var i=0; i < num_1/show_content_num; i++) {
		obj_1 = document.getElementById("scroller"+i);
		obj_1.style.top = parseInt(obj_1.style.top) - 1;
		
		if (parseInt(obj_1.style.top) == scroll_height*(num_1-show_content_num)*(-1)){
			obj_1.style.top = scroll_height*show_content_num;
		}
	}
		if (parseInt(obj_1.style.top)%scroll_height == 0) {
		/*if (parseInt(scroller0.style.top)%scroll_height == 0) {*/
			scrolling_stop_1();
			timer_1 = setTimeout("mainFrame_1()", 1);
			return;
		}
	timer_1 = setTimeout("scrolling_1()", scroll_time);
}

function scrolling_stop_1() {
	clearTimeout(timer_1);
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -