不能添加函数名呢
function gundong(){
var area = document.getElementById('guanggao');
var con1 = document.getElementById('con1');
var con2 = document.getElementById('con2');
var speed = 3000;
var myScroll = setInterval('scrollUp()', speed);
area.scrollTop = 0;
function scrollUp(){
if (area.scrollTop >= con1.scrollHeight) {
area.scrollTop = 0;
}else{
con2.innerHTML = con1.innerHTML;
area.scrollTop += area.offsetHeight;
}
}
area.onmouseover = function(){
clearInterval(myScroll);
}
area.onmouseout = function(){
myScroll =setInterval('scrollUp()', speed);
}
}
然后我调用的时候出现scrollUp() undefined;