|
站長我想把jave script的跑馬燈跟php的變數連結一起希望可以在後端同時輸入五個訊息,而這jave script可以輪播這五個訊息但我怎麼試都只能播放一個,不知站長是否能幫個忙??? <?php require_once('Connections/ehouse.php'); ?> <?php mysql_select_db($database_ehouse, $ehouse); $query_ehouse_news01 = "SELECT * FROM news ORDER BY news_id DESC limit 0,1"; $ehouse_news01 = mysql_query($query_ehouse_news01, $ehouse) or die(mysql_error()); $row_ehouse_news01 = mysql_fetch_assoc($ehouse_news01); $totalRows_ehouse_news01 = mysql_num_rows($ehouse_news01);
mysql_select_db($database_ehouse, $ehouse); $query_ehouse_news02 = "SELECT * FROM news ORDER BY news_id DESC limit 1,1"; $ehouse_news02 = mysql_query($query_ehouse_news02, $ehouse) or die(mysql_error()); $row_ehouse_news02 = mysql_fetch_assoc($ehouse_news02); $totalRows_ehouse_news02 = mysql_num_rows($ehouse_news02); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <title>無標題文件</title> </head>
<body><script language="JavaScript1.2"> <!-- var sliderwidth=700 var sliderheight=133 var slidespeed=4
var line=new Array() line[1]="<?php echo $row_ehouse_news01['news']; ?>" line[2]="<?php echo $row_ehouse_news02['news']; ?>" line[3]="<?php echo $row_ehouse_news03['news']; ?>" line[4]="<?php echo $row_ehouse_news04['news']; ?>" line[5]="<?php echo $row_ehouse_news05['news']; ?>"
var longestmessage=1 for (i=1;i<line.length;i++){ if (line[i].length>line[longestmessage].length) longestmessage=i } //Auto set scroller width var tscroller_width=line[longestmessage].length*4 lines=line.length-1 //--Number of lines
if (document.all){ document.write('<marquee id="ieslider" scrollAmount=0 style="width:'+sliderwidth+'">'+line+'</marquee>') ieslider.onmouseover=new Function("ieslider.scrollAmount=0") ieslider.onmouseout=new Function("if (document.readyState=='complete') ieslider.scrollAmount=slidespeed") }
function regenerate(){ window.location.reload() } function regenerate112(){ if (document.layers){ document.ns_slider01.visibility="show" setTimeout("window.onresize=regenerate",700) intializeline() } if (document.all) ieslider.scrollAmount=slidespeed }
function intializeline(){ document.ns_slider01.document.ns_slider02.document.write('<nobr>'+line+'</nobr>') document. ns_slider01.document.ns_slider02.document.close() thelength=document.ns_slider01.document.ns_slider02.document.width scrollslide() }
function scrollslide(){ if (document.ns_slider01.document.ns_slider02.left>=thelength*(-1)){ document.ns_slider01.document.ns_slider02.left-=slidespeed setTimeout("scrollslide()",200) } else{ document.ns_slider01.document.ns_slider02.left=sliderwidth scrollslide() } } window.onload=regenerate112
//--> </script>
</body> </html> <?php mysql_free_result($ehouse_news01);
mysql_free_result($ehouse_news02); ?>
|