这是一段点击按钮图片才左右移动的asp代码,如何更改使他默认为左移动的
这是一段点击按钮图片才左右移动的asp代码,如何更改使他默认为左移动的:<tdalign="right"width="9"><imgsrc="{$csspicurl}Le...
这是一段点击按钮图片才左右移动的asp代码,如何更改使他默认为左移动的:
<td align="right" width="9"><img src="{$csspicurl}Left_button.gif" name="Left" id="Left" style="CURSOR: hand" /></td>
<td><div id="demo" style="OVERFLOW: hidden; WIDTH: 520px" align="center">
<table cellpadding="0" width="98%" align="center" border="0" cellspace="0">
<tr>
<td id="demo1" valign="top"><table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td align="middle"><div class=img_framed>{$Showpicarticle(0,0,0,10,10,0,15,120,90,200,False,False)}</div></td>
</tr>
</table></td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div></td>
<td width="9"><img id="right" style="CURSOR: hand" src="{$csspicurl}Rigth_button.gif" name="right" /></td>
</tr>
</table>
<input name="hidden" type="hidden" id="direction" value="0" />
<script>
var speed=30;
demo2.innerHTML=demo1.innerHTML
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="right">
demo.scrollLeft=0;
demo.scrollLeft=demo.scrollWidth
document.all["direction"].value = "MarqueeRight";
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="Left">
demo.scrollLeft=0;
document.all["direction"].value = "MarqueeLeft";
</script>
<script>
function Marquee(){
if(document.all["direction"].value=="MarqueeRight")
{
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
else if(document.all["direction"].value=="MarqueeLeft")
{
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
</td>
</tr>
</table> 展开
<td align="right" width="9"><img src="{$csspicurl}Left_button.gif" name="Left" id="Left" style="CURSOR: hand" /></td>
<td><div id="demo" style="OVERFLOW: hidden; WIDTH: 520px" align="center">
<table cellpadding="0" width="98%" align="center" border="0" cellspace="0">
<tr>
<td id="demo1" valign="top"><table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td align="middle"><div class=img_framed>{$Showpicarticle(0,0,0,10,10,0,15,120,90,200,False,False)}</div></td>
</tr>
</table></td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div></td>
<td width="9"><img id="right" style="CURSOR: hand" src="{$csspicurl}Rigth_button.gif" name="right" /></td>
</tr>
</table>
<input name="hidden" type="hidden" id="direction" value="0" />
<script>
var speed=30;
demo2.innerHTML=demo1.innerHTML
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="right">
demo.scrollLeft=0;
demo.scrollLeft=demo.scrollWidth
document.all["direction"].value = "MarqueeRight";
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="Left">
demo.scrollLeft=0;
document.all["direction"].value = "MarqueeLeft";
</script>
<script>
function Marquee(){
if(document.all["direction"].value=="MarqueeRight")
{
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
else if(document.all["direction"].value=="MarqueeLeft")
{
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
</td>
</tr>
</table> 展开
1个回答
展开全部
替换成下面这些就可以了:
<td align="right" width="9"><img src="{$csspicurl}Left_button.gif" name="Left" id="Left" style="CURSOR: hand" /></td>
<td><div id="demo" style="OVERFLOW: hidden; WIDTH: 520px" align="center">
<table cellpadding="0" width="98%" align="center" border="0" cellspace="0">
<tr>
<td id="demo1" valign="top"><table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td align="middle"><div class=img_framed>{$Showpicarticle(0,0,0,10,10,0,15,120,90,200,False,False)}</div></td>
</tr>
</table></td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div></td>
<td width="9"><img id="right" style="CURSOR: hand" src="{$csspicurl}Rigth_button.gif" name="right" /></td>
</tr>
</table>
<input name="hidden" type="hidden" id="direction" value="0" />
<script>
demo.scrollLeft=0;
document.all["direction"].value = "MarqueeLeft";
</script>
<script>
var speed=30;
demo2.innerHTML=demo1.innerHTML
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="right">
demo.scrollLeft=0;
demo.scrollLeft=demo.scrollWidth
document.all["direction"].value = "MarqueeRight";
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="Left">
demo.scrollLeft=0;
document.all["direction"].value = "MarqueeLeft";
</script>
<script>
function Marquee(){
if(document.all["direction"].value=="MarqueeRight")
{
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
else if(document.all["direction"].value=="MarqueeLeft")
{
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
</td>
</tr>
</table>
<td align="right" width="9"><img src="{$csspicurl}Left_button.gif" name="Left" id="Left" style="CURSOR: hand" /></td>
<td><div id="demo" style="OVERFLOW: hidden; WIDTH: 520px" align="center">
<table cellpadding="0" width="98%" align="center" border="0" cellspace="0">
<tr>
<td id="demo1" valign="top"><table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td align="middle"><div class=img_framed>{$Showpicarticle(0,0,0,10,10,0,15,120,90,200,False,False)}</div></td>
</tr>
</table></td>
<td id="demo2" valign="top"></td>
</tr>
</table>
</div></td>
<td width="9"><img id="right" style="CURSOR: hand" src="{$csspicurl}Rigth_button.gif" name="right" /></td>
</tr>
</table>
<input name="hidden" type="hidden" id="direction" value="0" />
<script>
demo.scrollLeft=0;
document.all["direction"].value = "MarqueeLeft";
</script>
<script>
var speed=30;
demo2.innerHTML=demo1.innerHTML
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="right">
demo.scrollLeft=0;
demo.scrollLeft=demo.scrollWidth
document.all["direction"].value = "MarqueeRight";
</script>
<script language="JavaScript" type="text/javascript" event="onclick" for="Left">
demo.scrollLeft=0;
document.all["direction"].value = "MarqueeLeft";
</script>
<script>
function Marquee(){
if(document.all["direction"].value=="MarqueeRight")
{
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
else if(document.all["direction"].value=="MarqueeLeft")
{
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
</td>
</tr>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询