html怎么设置图片滚动播放

html怎么设置图片滚动播放,第1张

<DIV id=demo style="overflow: hiddenwidth: 600pxheight: 190pxtop:485pxleft:252pxposition: absolute">

<table border="0" cellspacing="0" cellpadding="0">

<tr>

<td valign="top" id=demo1>

<!-- 循环滚动的图片 -->

<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" >

<tr>

<td width="200" align="center" style="height: 151px">

<a href="WebDeSign.aspx">

<img src="images/indexpic1.gif" width="194" height="147" border="0" /></a>

</td>

<td width="200" align="center" style="height: 151px">

<a href="SoftWare.aspx">

<img src="images/indexpic2.gif" width="194" height="147" border="0" /></a>

</td>

你先试试这个代码(先用背景颜色来代码替):

<html>

<head>

</head>

<body>

<div id="div1" style="width:100pxheight:100pxbackground:red">

</div>

<script>

var adiv=document.getElementById('div1')

var colors=['green','black','pink','blue','yellow','gray','red']

var i=0

setInterval(function()

{

if(i==colors.length)

{

i=0

}

adiv.style.backgroundColor=colors[i]

i++

},1000)

</script>

</body>

</html>

看能不能帮上什么。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7680721.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-08
下一篇 2023-04-08

发表评论

登录后才能评论

评论列表(0条)

保存