首页图片切换Html和JS代码如下:这个图片显示总是在左边,求高手帮我修改吧图片显示在中间,
<!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Conten...
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScript 图片滑动切换效果</title>
<script src="SlideTrans.js"></script>
</head>
<body>
<style type="text/css">
.flash{width:210px; height:210px;}
.container, .container img{width:980px; height:610px;text-align:center;}
.container img{border:0;vertical-align:top;}
table{ heightd:80%; width:100%; text-align:center;}
</style>
<a href="http://www.baidu.com/"><img src="2.jpg"/></a>
<div class="flash">
<div class="container" id="idContainer">
<table id="idSlider" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="http://www.baidu.com"><img src="1.jpg"/></a></td>
<td> </td>
<td><a href="http://www.baidu.com/"><img src="3.jpg"/></a></td>
</tr>
</table>
</div>
</div>
<script>
new SlideTrans("idContainer", "idSlider", 3, { Vertical: false }).Run();
</script>
</body>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScript 图片滑动切换效果</title>
<script src="SlideTrans.js"></script>
</head>
<body>
<style type="text/css">
.flash{width:210px; height:210px;}
.container, .container img{width:980px; height:610px;text-align:center;}
.container img{border:0;vertical-align:top;}
table{ heightd:80%; width:100%; text-align:center;}
</style>
<a href="http://www.baidu.com/"><img src="2.jpg"/></a>
<div class="flash">
<div class="container" id="idContainer">
<table id="idSlider" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a href="http://www.baidu.com"><img src="1.jpg"/></a></td>
<td> </td>
<td><a href="http://www.baidu.com/"><img src="3.jpg"/></a></td>
</tr>
</table>
</div>
</div>
<script>
new SlideTrans("idContainer", "idSlider", 3, { Vertical: false }).Run();
</script>
</body>
</html> 展开
1个回答
展开全部
<script language=JavaScript>
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]="低下这些都是图片";
bannerADlink[0]="image\\cat.png";
bannerAD[1]="image\\spaceshuttle-closeup.jpg";
bannerADlink[1]="image\\spaceshuttle-closeup.jpg";
bannerAD[2]="image\\person.png";
bannerADlink[2]="image\\person.png"
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
</script>
参考
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]="低下这些都是图片";
bannerADlink[0]="image\\cat.png";
bannerAD[1]="image\\spaceshuttle-closeup.jpg";
bannerADlink[1]="image\\spaceshuttle-closeup.jpg";
bannerAD[2]="image\\person.png";
bannerADlink[2]="image\\person.png"
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}
function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}
function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}
function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
</script>
参考
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询