⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 java29.htm

📁 javascript book
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>加快图片显示</title>
<meta name="Microsoft Theme" content="maize 011">
</head>

<body background="maizbk.jpg" bgcolor="#FFFFFF" text="#000000" link="#669999" vlink="#999900" alink="#3366CC">

<!--mstheme--><font face="宋体"><!--mstheme--></font>

<table border="0" width="100%">
  <tr>
    <td width="100%"><!--mstheme--><font face="宋体"><br>
      <br>
      <center><font face="隶书" size="6">加快图片显示(说明)</font></center><br>
      <center>
      <!--mstheme--></font>
      <table border="5" borderColor="blue" borderlight="green">
        <tbody>
          <tr>
            <td align="middle" height="70" width="450"><!--mstheme--><font face="宋体">预先读取图片的方法是比较简单的,用javascript这样实现。<br>
              将如下的类似代码放在HTML的&lt;head&gt;区:<br>
              &lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;<br>  
              &lt;!--<br>  
              Image1= new Image(100,50)<br>  
              Image1.src = &quot;image1.gif&quot;<br>  
              Image2 = new Image(100,50)<br>  
              Image2.src = &quot;image2.gif&quot;<br>  
              Image3 = new Image(100,50)<br>  
              Image3.src = &quot;image3.gif&quot;<br>  
              // --&gt;<br>  
              &lt;/SCRIPT&gt;<br>  
              这样浏览器在装载页面时就已经预先下载了3个图片<br>  
              (image1.gif,images2.gif和image3.gif)。<br>  
              当激发onmouseover事件时,浏览器直接从Cache中读取图片,<br>  
              速度当然快多了。<br>  
              这里做一些小小说明:图片的名字可以是任意的,<br>  
              100和50分别是读入cache的图片的宽度和高度。<br>  
              但是脚本格式必须按照规定的格式写,&quot;Image1=new   
              Image&quot;。<br>  
              如果图片在其它服务器的子目录内,<br>  
              只要用正确的绝对路径表示即可。<br>  
              <!--mstheme--></font>  
            </td>  
          </tr>  
        </tbody>  
      </table>  
      <!--mstheme--><font face="宋体"> 
      </center> 
      <p> <!--mstheme--></font></td> 
  </tr> 
</table> 
 
<!--mstheme--><font face="宋体"><!--mstheme--></font> 
 
</body> 
 
</html> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -