html图片循环滚动无缝隙
发布网友
发布时间:2022-04-25 12:01
我来回答
共5个回答
热心网友
时间:2022-04-19 07:33
html图片循环滚动无缝隙代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
/*gundongtupian*/
#demo0 {
width:712px;
height:134px;
overflow:hidden;
margin:auto;
}
#demo0 img {
float:left;
margin-left:10px;
border:3px #ffffff solid;
}
#indemo0 {
float: left;
width: 800%;
}
#demo10 {
float: left;
}
#demo20 {
float: left;
}
</style>
</head><body>
<div id="demo0">
<div id="indemo0">
<div id="demo10">
<a href="#"><img src="images/tu1.jpg" width="167" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
</div>
<div id="demo20"></div>
</div>
</div>
<script language="javascript">
<!--
var speed0=40; //数字越大速度越慢
var tabb=document.getElementById("demo0");
var tabb1=document.getElementById("demo10");
var tabb2=document.getElementById("demo20");
tabb2.innerHTML=tabb1.innerHTML+tabb1.innerHTML;
function Marquee2(){
if(tabb2.offsetWidth-tabb.scrollLeft<=0)
tabb.scrollLeft-=tabb1.offsetWidth;
else{
tabb.scrollLeft++;
}
}
var MyMar2=setInterval(Marquee2,speed0);
tabb.onmouseover=function(){clearInterval(MyMar2)};
tabb.onmouseout=function(){MyMar2=setInterval(Marquee2,speed0)};
-->
</script>
</body>
</html>
热心网友
时间:2022-04-19 08:51
1、准备好图片素材和网页工具以及上传工具;
2、html图片循环滚动无缝隙实现效果的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
<html xmlns="
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
/*gundongtupian*/
#demo0 {
width:712px;
height:134px;
overflow:hidden;
margin:auto;
}
#demo0 img {
float:left;
margin-left:10px;
border:3px #ffffff solid;
}
#indemo0 {
float: left;
width: 800%;
}
#demo10 {
float: left;
}
#demo20 {
float: left;
}
</style>
</head><body>
<div id="demo0">
<div id="indemo0">
<div id="demo10">
<a href="#"><img src="images/tu1.jpg" width="167" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
</div>
<div id="demo20"></div>
</div>
</div>
<script language="javascript">
<!--
var speed0=40; //数字越大速度越慢
var tabb=document.getElementById("demo0");
var tabb1=document.getElementById("demo10");
var tabb2=document.getElementById("demo20");
tabb2.innerHTML=tabb1.innerHTML+tabb1.innerHTML;
function Marquee2(){
if(tabb2.offsetWidth-tabb.scrollLeft<=0)
tabb.scrollLeft-=tabb1.offsetWidth;
else{
tabb.scrollLeft++;
}
}
var MyMar2=setInterval(Marquee2,speed0);
tabb.onmouseover=function(){clearInterval(MyMar2)};
tabb.onmouseout=function(){MyMar2=setInterval(Marquee2,speed0)};
-->
</script>
</body>
</html>
3、保存成为.html的网页,然后通过ftp上传到服务器上。
热心网友
时间:2022-04-19 10:26
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
/*gundongtupian*/
#demo0 {
width:712px;
height:134px;
overflow:hidden;
margin:auto;
}
#demo0 img {
float:left;
margin-left:10px;
border:3px #ffffff solid;
}
#indemo0 {
float: left;
width: 800%;
}
#demo10 {
float: left;
}
#demo20 {
float: left;
}
</style>
</head><body>
<div id="demo0">
<div id="indemo0">
<div id="demo10">
<a href="#"><img src="images/tu1.jpg" width="167" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
</div>
<div id="demo20"></div>
</div>
</div>
<script language="javascript">
<!--
var speed0=40; //数字越大速度越慢
var tabb=document.getElementById("demo0");
var tabb1=document.getElementById("demo10");
var tabb2=document.getElementById("demo20");
tabb2.innerHTML=tabb1.innerHTML+tabb1.innerHTML;
function Marquee2(){
if(tabb2.offsetWidth-tabb.scrollLeft<=0)
tabb.scrollLeft-=tabb1.offsetWidth;
else{
tabb.scrollLeft++;
}
}
var MyMar2=setInterval(Marquee2,speed0);
tabb.onmouseover=function(){clearInterval(MyMar2)};
tabb.onmouseout=function(){MyMar2=setInterval(Marquee2,speed0)};
-->
</script>
</body>
</html>
热心网友
时间:2022-04-19 12:17
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
/*gundongtupian*/
#demo0 {
width:712px;
height:134px;
overflow:hidden;
margin:auto;
}
#demo0 img {
float:left;
margin-left:10px;
border:3px #ffffff solid;
}
#indemo0 {
float: left;
width: 800%;
}
#demo10 {
float: left;
}
#demo20 {
float: left;
}
</style>
</head>
<body>
<div id="demo0">
<div id="indemo0">
<div id="demo10">
<a href="#"><img src="images/tu1.jpg" width="167" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
<a href="#"><img src="images/tu1.jpg" width="168" height="128" border="0" /></a>
</div>
<div id="demo20"></div>
</div>
</div>
<script language="javascript">
<!--
var speed0=40; //数字越大速度越慢
var tabb=document.getElementById("demo0");
var tabb1=document.getElementById("demo10");
var tabb2=document.getElementById("demo20");
tabb2.innerHTML=tabb1.innerHTML+tabb1.innerHTML;
function Marquee2(){
if(tabb2.offsetWidth-tabb.scrollLeft<=0)
tabb.scrollLeft-=tabb1.offsetWidth;
else{
tabb.scrollLeft++;
}
}
var MyMar2=setInterval(Marquee2,speed0);
tabb.onmouseover=function(){clearInterval(MyMar2)};
tabb.onmouseout=function(){MyMar2=setInterval(Marquee2,speed0)};
-->
</script>
</body>
</html>
热心网友
时间:2022-04-19 14:25
单独的marquee是不具备无缝滚动的属性的需要js脚本才可以的!