|
1.先建立一個flash.js的JS文件,并寫入
復制代碼 代碼如下:
function flash(ur,w,h){
document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+w+'" height="'+h+'">');
document.write('<param name="movie" value="'+ur+'">');
document.write('<param name="quality" value="high"> ');
document.write('<param name="wmode" value="transparent"> ');
document.write('<param name="menu" value="false"> ');
document.write('<embed src="'+ur+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="'+w+'" height="'+h+'" quality="High" wmode="transparent">');
document.write('</embed>');
document.write('</object>');
}
2.在網頁里<head>與</head>之間寫入調用JS的代碼:
復制代碼 代碼如下:
<script type="text/Javascript" language="Javascript" src="flash.js"></script>
3.然后在網頁主體內容里寫入調用flash的代碼(只要是flash都可以調用):
復制代碼 代碼如下:
<script language="Javascript" type="text/Javascript">flash('images/01.swf','529','600');</script>
<script language="Javascript" type="text/Javascript">flash('images/02.swf','529','600');</script>
<script language="Javascript" type="text/Javascript">flash('images/03.swf','529','600');</script>
JavaScript技術:比較簡單的一個符合web標準的JS調用flash方法,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。