JAVA 高手请进。 5
我让信息滚动,但信息出来两条,是怎么回事?<SCRIPTlanguage=JavaScripttype=text/javascript><!--try{varmarque...
我让信息滚动,但信息出来两条,是怎么回事?
<SCRIPT language=JavaScript type=text/javascript>
<!--
try{
var marqueesHeight2 = 310;
var stopscroll2 = false;
var scrollElem1 = document.getElementById("ice103");
with(scrollElem1){
style.width = 432;
style.height = marqueesHeight2;
style.overflow = 'hidden';
noWrap = true;
}
scrollElem1.onmouseover = new Function('stopscroll2 = true');
scrollElem1.onmouseout = new Function('stopscroll2 = false');
var preTop2 = 0;
var currentTop2 = 0;
var stoptime2 = 0;
var leftElem1 = document.getElementById("boxs");
scrollElem1.appendChild(leftElem1.cloneNode(true));
init_srolltext2();
}catch(e) {}
function init_srolltext2(){
scrollElem1.scrollTop = 0;
setInterval('scrollUp2()', 15);
}
function scrollUp2(){
if(stopscroll2) return;
currentTop2 += 1;
if(currentTop2 == 20) {
stoptime2 += 1;
currentTop2 -= 1;
if(stoptime2 == 200) {
currentTop2 = 0;
stoptime2 = 0;
}
}else{
preTop2 = scrollElem1.scrollTop;
scrollElem1.scrollTop += 2;
if(preTop2 == scrollElem1.scrollTop){
scrollElem1.scrollTop = 0;
scrollElem1.scrollTop += 2;
}
}
}
//-->
</SCRIPT>
或给点文字上下滚动(走走停停)的代码也行的。 展开
<SCRIPT language=JavaScript type=text/javascript>
<!--
try{
var marqueesHeight2 = 310;
var stopscroll2 = false;
var scrollElem1 = document.getElementById("ice103");
with(scrollElem1){
style.width = 432;
style.height = marqueesHeight2;
style.overflow = 'hidden';
noWrap = true;
}
scrollElem1.onmouseover = new Function('stopscroll2 = true');
scrollElem1.onmouseout = new Function('stopscroll2 = false');
var preTop2 = 0;
var currentTop2 = 0;
var stoptime2 = 0;
var leftElem1 = document.getElementById("boxs");
scrollElem1.appendChild(leftElem1.cloneNode(true));
init_srolltext2();
}catch(e) {}
function init_srolltext2(){
scrollElem1.scrollTop = 0;
setInterval('scrollUp2()', 15);
}
function scrollUp2(){
if(stopscroll2) return;
currentTop2 += 1;
if(currentTop2 == 20) {
stoptime2 += 1;
currentTop2 -= 1;
if(stoptime2 == 200) {
currentTop2 = 0;
stoptime2 = 0;
}
}else{
preTop2 = scrollElem1.scrollTop;
scrollElem1.scrollTop += 2;
if(preTop2 == scrollElem1.scrollTop){
scrollElem1.scrollTop = 0;
scrollElem1.scrollTop += 2;
}
}
}
//-->
</SCRIPT>
或给点文字上下滚动(走走停停)的代码也行的。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询