用DW做网页设计,就是那种图片在循环滚动,点击就可以进入,这种效果如何做
3个回答
展开全部
自己复制下去 写在.html 看看 很简单的
<style>
#demoa {
overflow:hidden;
width: 690px;
}
#demoa img {
}
#indemoa {
float: left;
width: 800%;
}
#demoa1 {
float: left;
}
#demoa2 {
float: left;
}
</style>
<div id="demoa">
<div id="indemoa">
<div id="demoa1">
<div>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<div class="clear"></div>
</div>
</div>
<div id="demoa2">
<div>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<div class="clear"></div>
</div>
</div>
</div>
<script>
<!--
var speed=50;
var tab=document.getElementById("demoa");
var tab1=document.getElementById("demoa1");
var tab2=document.getElementById("demoa2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script>
<style>
#demoa {
overflow:hidden;
width: 690px;
}
#demoa img {
}
#indemoa {
float: left;
width: 800%;
}
#demoa1 {
float: left;
}
#demoa2 {
float: left;
}
</style>
<div id="demoa">
<div id="indemoa">
<div id="demoa1">
<div>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<div class="clear"></div>
</div>
</div>
<div id="demoa2">
<div>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<a href="http://www.baidu.com"><img src="image/dh.png"></a>
<div class="clear"></div>
</div>
</div>
</div>
<script>
<!--
var speed=50;
var tab=document.getElementById("demoa");
var tab1=document.getElementById("demoa1");
var tab2=document.getElementById("demoa2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询