喜悦国际村 » XML/HTML/CSS/Js » 图片轮换的两次调用问题

页: [1]
nightwindw2008-4-8 06:56 AM
图片轮换的两次调用问题

<?
        include "config.inc.php";       
                     $link = @mysql_connect($host,$dbuser,$dbpass) or die('无法连接服务器');
                     @mysql_select_db(picture,$link) or die('无法连接数据库');
        mysql_query("SET   NAMES   GB2312");
        $sql="select * from picture order by pic_djl desc limit 0,5";
        @$result = mysql_query($sql,$link) or die('MYSQL出错,查询失败!');
        $i=0;
        $pic = array("0","1","2","3","4");
        while( $row = mysql_fetch_array($result))
     {
          
                $pictm=$row[pic_ratio];
                $pic[$i]=substr($pictm,12);
               
                $i++;

          }

?>
<div id=oTransContainer
style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0,wipeStyle=0, motion='forward'); WIDTH: 165px; HEIGHT: 103px"><a
href="http://xxxx"
target=_blank><img class=pic id=oDIV1
style="BORDER-RIGHT: white 1px solid; BORDER-TOP: white 1px solid; BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid"
height=120 src="<? echo $pic[0] ?>"
width=150 border=0>
        <script>var NowFrame = 1;var MaxFrame = 5;var bStart = 0;function fnToggle(){var next = NowFrame + 1;if(next == MaxFrame+1) {NowFrame = MaxFrame;next = 1;}if(bStart == 0){bStart = 1;setTimeout('fnToggle()', 2000);return;}else{oTransContainer.filters[0].Apply();document.images['oDIV'+next].style.display = "";document.images['oDIV'+NowFrame].style.display = "none";oTransContainer.filters[0].Play(duration=2);if(NowFrame == MaxFrame){NowFrame = 1;}else{NowFrame++;}} setTimeout('fnToggle()', 6000);}fnToggle();</script>
        </a><a
href="http://xxxx"
target=_blank><img class=pic id=oDIV2
style="BORDER-RIGHT: white 1px solid; BORDER-TOP: white 1px solid; DISPLAY: none; BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid"
height=120 src="<? echo $pic[1] ?>"
width=150 border=0></a><a
href="http://xxxx"
target=_blank><img class=pic id=oDIV3
style="BORDER-RIGHT: white 1px solid; BORDER-TOP: white 1px solid; DISPLAY: none; BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid"
height=120 src="<? echo $pic[2] ?>"
width=150 border=0></a><a
href="http://xxxx"
target=_blank><img class=pic id=oDIV4
style="BORDER-RIGHT: white 1px solid; BORDER-TOP: white 1px solid; DISPLAY: none; BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid"
height=120 src="<? echo $pic[3] ?>"
width=150 border=0></a><a
href="http://xxxx"
target=_blank><img class=pic id=oDIV5
style="BORDER-RIGHT: white 1px solid; BORDER-TOP: white 1px solid; DISPLAY: none; BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid"
height=120 src="<? echo $pic[4];?>"
width=150 border=0></a></div>

代码如上。我想在同一个页面里两次调用这个代码。发现只能调用一次,调用两次就不能轮换了,我对这些非PHP代码不是很懂,请指教一二。谢谢


查看完整版本: 图片轮换的两次调用问题


Powered by Discuz! Archiver 6.1.0  © 2001-2006 Comsenz Inc.
Processed in 0.005785 second(s), 2 queries