求带按钮的图片横幅广告和滚动的新闻实现方法?
<script type="text/javascript">
var NowFram=1;
var MaxFram=4;
function scroll(d1){
if(Number(d1)){
clearTimeout(theTimer);
NowFram=d1;
}
for(var i =1; i<(MaxFram+1); i++){
if(NowFram==i){
document.getElementById('img_'+NowFram).style.display='block';
}
else{
document.getElementById('img_'+i).style.display='none';
}
}
{
if(NowFram==MaxFram)
NowFram=1;
else
NowFram++;
}
var theTimer=setTimeout('scroll()',1000);
}
</script>
<div id="guanggao" style="height:130px;width:500px;">
<asp:Image ID="img_1" runat="server" ImageUrl="~/Images/img_1.gif" Visible="true" />
<asp:Image ID="img_2" runat="server" ImageUrl="~/Images/img_2.gif" Visible="false" />
<asp:Image ID="img_3" runat="server" ImageUrl="~/Images/img_3.gif" Visible="false" />
<asp:Image ID="img_4" runat="server" ImageUrl="~/Images/img_4.gif" Visible="false" />
<div style="z-index:3; float:right;">
<span class="span" onmousemove="scroll(1)">1</span><br /><br />
<span class="span" onmousemove="scroll(2)">2</span><br /><br />
<span class="span" onmousemove="scroll(3)">3</span><br /><br />
<span class="span" onmousemove="scroll(4)">4</span>
</div>
</div>
在用户控件中是否可以写这段代码?如果可以,但它提示我dome和dome2未定义。各位告知小弟方法