怎么把html 的js特效在ASPX中试用??
<divid="demo"style="overflow:hidden;width:100%;color:#ffffff"><TABLEcellSpacing=0cell...
<div id="demo" style="overflow:hidden;width:100%; color:#ffffff">
<TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
<tbody>
<TR>
<TD id="demo1" valign="top" style="width: 750px; height: 128px"><table style="width:1710px; height:116px; overflow:hidden" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="171" background="images/pic_bg.jpg"><div align="center">1</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">2</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">3</div></td>
<td width="171" background="images/pic_bg.jpg">4</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">5</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">6</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">7</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">8</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">9</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">10</div></td>
</tr>
</table></TD>
<TD id="demo2" valign="top" style="width: 750px; height: 128px"> </TD></TR></tbody></TABLE></div>
<script language="javascript" type="text/javascript">
var speed3=25//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed3)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}
</script>
代码在html里可以用,但是在ASPX中不能用,而且overflow:hidden也没有效果?哪位大哥指点下,怎么在ASPX中使用JS特效
谢谢两位大哥啊,我重新建了个网页,发现能用~~ 呵呵、但是为什么之前的不能用呢? 之前那个我用了个js导航效果,还有css,不是因为这个吧? 我还是新手,做网站后台还挺熟,就是美化都是在网上找的代码。。指点下哈 展开
<TABLE cellSpacing=0 cellPadding=0 align=left border=0 cellspace="0">
<tbody>
<TR>
<TD id="demo1" valign="top" style="width: 750px; height: 128px"><table style="width:1710px; height:116px; overflow:hidden" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="171" background="images/pic_bg.jpg"><div align="center">1</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">2</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">3</div></td>
<td width="171" background="images/pic_bg.jpg">4</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">5</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">6</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">7</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">8</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">9</div></td>
<td width="171" background="images/pic_bg.jpg"><div align="center">10</div></td>
</tr>
</table></TD>
<TD id="demo2" valign="top" style="width: 750px; height: 128px"> </TD></TR></tbody></TABLE></div>
<script language="javascript" type="text/javascript">
var speed3=25//速度数值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed3)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed3)}
</script>
代码在html里可以用,但是在ASPX中不能用,而且overflow:hidden也没有效果?哪位大哥指点下,怎么在ASPX中使用JS特效
谢谢两位大哥啊,我重新建了个网页,发现能用~~ 呵呵、但是为什么之前的不能用呢? 之前那个我用了个js导航效果,还有css,不是因为这个吧? 我还是新手,做网站后台还挺熟,就是美化都是在网上找的代码。。指点下哈 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询