问题描述
一张网页上,以前放了个图片上下滚动的效果。今天又添加了一个文字滚动的效果,结果发现的下面的那个图片滚动效果不行了。本人不懂JS,只要求教了文字滚动:<!--滚动广告end---><pid="googleRS"><ahref="http://mark.sina.com.cn/v2/hot.php?keyword=公务员&hwfrom=www.sina.com.cn&tag=1&url=http://www.google.cn/search?client=aff-sina&ie=gb&oe=utf8&hl=zh-CN&channel=hotlink&q=公务员"target="_blank"></a><br/><ahref="http://mark.sina.com.cn/v2/hot.php?keyword=阿根廷乌拉圭&hwfrom=www.sina.com.cn&tag=1&url=http://www.google.cn/search?client=aff-sina&ie=gb&oe=utf8&hl=zh-CN&channel=hotlink&q=阿根廷乌拉圭"target="_blank">阿根廷出线</a><br/><ahref="http://mark.sina.com.cn/v2/hot.php?keyword=臧天朔翻供&hwfrom=www.sina.com.cn&tag=1&url=http://www.google.cn/search?client=aff-sina&ie=gb&oe=utf8&hl=zh-CN&channel=hotlink&q=臧天朔翻供"target="_blank">臧天朔翻供</a><br/></p><scripttype="text/javascript"><!--(function(){varpthis=this;this.$=function(a){if(document.getElementById){returneval('document.getElementById("'+a+'")')}else{if(document.layers){returneval("document.layers['"+a+"']")}else{returneval("document.all."+a)}}};this.SinaDotMarquee=function(id,h,s,d){varapthis=this;vart;varp=false;varo=pthis.$(id);o.style.overflow="hidden";o.style.height=h+"px";o.style.lineHeight=h+"px";o.innerHTML+=o.innerHTML;o.onmouseover=function(){p=true};o.onmouseout=function(){p=false};o.scrollTop=0;this.doScroll=function(){t=setInterval(apthis.scrolling,s);if(!p){o.scrollTop+=2}};this.scrolling=function(){if(o.scrollTop%h!=0){o.scrollTop+=2;if(o.scrollTop>=o.scrollHeight/2){o.scrollTop=0}}else{clearInterval(t);setTimeout(apthis.doScroll,d)}};setTimeout(apthis.doScroll,d)};try{varSinaDotMarquee01=newSinaDotMarquee("googleRS",18,50,5000)}catch(e){}})();//--></script><!--滚动广告end--->图片滚动:SCRIPTtype=text/javascript>functionAutoScroll(obj){$(obj).find("ul:first").animate({marginTop:"-152px"},1000,function(){$(this).css({marginTop:"0px"}).find("li:first").appendTo(this);});}$(document).ready(function(){setInterval('AutoScroll("#scrollDiv")',3000)});</SCRIPT><DIVid=scrollDiv><UL>图片内容</UL></DIV>打开页面提示:null为空,或者不是对象出现行为上面红色标记部分!求助
解决方案
解决方案二:
我正在解决这个问题。你可以用两个js文件,存放两个滚动图层的js方法这样就不会起冲突了