日期:2014-05-16  浏览次数:20414 次

以下是标题切换图片,但是有个遗憾,下面的文字会随着第三张图片的切换而上下抖动,哪位朋友帮忙修改下,100分送上,谢~急~
以下是标题切换图片JS代码,但是有个遗憾,下面的文字111会随着第三张图片的切换而上下抖动,哪位朋友帮忙修改下,100分送上,谢~

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>
<SCRIPT language="javascript">
var NowFrame = 1;
var MaxFrame = 3;
var bStart = 0;
function fnToggle() {
var next = NowFrame + 1;
if(next == MaxFrame+1) 
{
NowFrame = MaxFrame;
next = 1;
}
if(bStart == 0)
{
bStart = 1;
 
setTimeout('fnToggle()', 1000);
return;
}
else
{
oTransContainer.filters[0].Apply();
document.images['oDIV'+next].style.display = "";
document.images['oDIV'+NowFrame].style.display = "none"; 
oTransContainer.filters[0].Play(duration=3);
if(NowFrame == MaxFrame) 
NowFrame = 1;
else
NowFrame++;
} setTimeout('fnToggle()', 6000);
}
fnToggle();
</SCRIPT>
 <BODY>
  <table width="778" height="150" border="0" align="center" cellpadding="0" cellspacing="2">
  <tr>
  <td width="135" height="150" valign="top"><img src="images/logo.jpg" width="135" height="150" border="0" usemap="#Map" /></td>
  <td width="643" height="150" valign="top">

<!--焦点图片开始-->
<DIV id=oTransContainer style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=0, motion='forward'); WIDTH: 643px; HEIGHT: 150px">
<A href="images\01.jpg" target=_blank><IMG id=oDIV1 style="BORDER-RIGHT: black 0px solid; BORDER-TOP: black 0px solid; DISPLAY: yes; BORDER-LEFT: black 0px solid; BORDER-BOTTOM: black 0px solid" height=150 src="pic\01.jpg" width=643 border=0></A>
<A href="images\02.jpg" target=_blank><IMG id=oDIV2 style="BORDER-RIGHT: black 0px solid; BORDER-TOP: black 0px solid; DISPLAY: none; BORDER-LEFT: black 0px solid; BORDER-BOTTOM: black 0px solid" height=150 src="pic\02.jpg" width=643 border=0></A>
<A href="images\03.jpg" target=_blank><IMG id=oDIV3 style="BORDER-RIGHT: black 0px solid; BORDER-TOP: black 0px solid; DISPLAY: none; BORDER-LEFT: black 0px solid; BORDER-BOTTOM: black 0px solid" height=150 src="pic\03.jpg" width=643 border=0></A></DIV>
<!--焦点图片结束-->
</td>
  </tr>
</table>
111
 </BODY>
</HTML>

------解决方案--------------------

document.images['oDIV'+next].style.display = ""; 
document.images['oDIV'+NowFrame].style.display = "none";
改成
document.images['oDIV'+next].style.visibility="visible"; 
document.images['oDIV'+NowFrame].style.visibility="hidden";
------解决方案--------------------
感觉没有问题,要不你就
var time1=0;
clearTimeout(time1);
time1=setTimeout('fnToggle()', 6000);
在调用前先清除一下之前的