|
Ok,这是显示图片的JAVASCRIPT代码,通常是.gif .jpg .png
现在问题是我要放SWF的文件,我该怎样呢?
- <script language="JavaScript">
- Images[0] ='<img src="kl.gif">';
- Images[1] ='<img src="banner_carnivalC.swf">'; (错误!!!)
- var j = 0;
- var p = Image.length;
- var preBuffer = new Array()
- for (i = 0; i < p; i++){
- preBuffer[i] = new Image()
- preBuffer[i].src = Images[i]
- }
- var whichImage = Math.round(Math.random()*(p-1));
- function showImage(){
- document.write( theImages[whichImage] );
- }
- </script>
复制代码 |
|