Welcome to WebmasterWorld Guest from 54.221.119.45

Forum Moderators: open

Message Too Old, No Replies

Code for preload

DreamWeaver code is rather bloated

     

kapow

5:42 pm on Aug 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using DreamWeaver but its code for things like an image preload is rather bloated.

Can someone tell me a nice short code to get a button and logo to preload e.g. something in the head tad would be good.

tedster

8:02 pm on Aug 6, 2003 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Simple image preload:

<script type="text/javascript">

image01=new Image(111,222)
image02=new Image(33,44)

image01.src="logo.png"
image02.src="button.gif"

//-->
</script>

kapow

8:56 am on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks
Is it ok in the head tag?

korkus2000

1:32 pm on Aug 7, 2003 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yes that works in the head tag. You could actually put it anywhere, but I believe it will start preloading earlier in the head tag. You could make it a function and add it to your onload event in the body tag if you want preload to start after the page loads. That way your page won't wait to finish loading until the preload is done.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month