Re: NEWBEE - How do I preload 25< gifs?
| From: | Visa Kopu | Date: | Thu, 15 Mar 2001 10:03:34 +0000 |
| Subject: | Re: NEWBEE - How do I preload 25< gifs? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-44002@lists.php.net to get a copy of this message | ||
In article <98p4a1$mbn$1@toye.p.sourceforge.net>,
Laf@DHSaps.dk ("Lars Falsig") wrote:
> I need to preload lots of graphics for user-controlled animation, changing
> graphics fast.
> Include() and/or require() works to slow.
>
> Any suggestions?
You can't do that with PHP as it's *server-side* scripting language.
Image caching must be done client-side, using for example JavaScript.
Try this in the HEAD section of your HTML page:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
if (document.images)
{
img01 = new Image();
img01.src = "path/to/your/image.gif";
img02 = new Image();
img02.src = "path/to/your/other_image.gif";
// and so on...
}
// -->
</SCRIPT>
- Visa