Your browser does not seem to support CSS. If images appear below, please disregard them.
toggle
July
S M T W T F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Sponsored Links
Latest Postings
· Blackbeard.....
by Gremelin on 07/04/16 08:31 PM
Topic Options
Rate This Topic
#18569 - 10/16/02 03:53 AM preload images
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
Is there a html script or javascript that i could use to preload the images on a webpage?


2 people can keep a secret as long as one is dead
Top
Sponsored Links
#18570 - 10/16/02 10:22 AM Re: preload images
Joined: Oct 2002
Posts: 21
Energy Offline
Junior Member
Energy Offline
Junior Member

Joined: Oct 2002
Posts: 21
D you mean how do you specify the height and width of an image so the page, as it loads, knows how to place the text? If so the html syntax is:

My Image

The 48 is in pixels.

A nice link is
http://www.devguru.com for many web coding questions.

Top
#18571 - 10/17/02 01:45 AM Re: preload images
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
I mean... you know how the html loads first and then it takes time to load the pictures after... and for me (on a 24k connection) it takes forever to load the pictures. I'd like for the pictures to be preloaded so everythign loads at once, i know it will take just as long to load but id b a nice feature. if you know what i mean... im not a very good explainer.


2 people can keep a secret as long as one is dead
Top
#18572 - 10/17/02 06:26 AM Re: preload images
Joined: Mar 2002
Posts: 599
BackSlash Offline
UGN's Resident Homo
BackSlash Offline
UGN's Resident Homo

Joined: Mar 2002
Posts: 599
TN
in javascript it is....

Code:
<HEAD>

<SCRIPT language="JavaScript">

Image1= new Image(200,200)
Image1.src = "image.gif"

Image2= new Image(340,200)
Image2.src = "coolpic.jpg"

</SCRIPT>

</HEAD>

  
I think thats pretty much self explanitory. The variable name you use is irrelevant because you don't use that to call the image. You still put the image on your page like normal, this code just brings it into the cache before hand for a fast load. Think thats what you wanted.


"It's better to burn out, than to fade away."
Top
#18573 - 10/18/02 03:17 AM Re: preload images
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox Offline
Junior Member

Joined: Oct 2002
Posts: 37
I do mine in an extremely complex and dynamic manner. If you are doing yours dynamically as well. You may want to think about doing something like this.
Create a javascript function that looks similar to this.
Code:
function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
That is my javascript function. Then I proceed to call it like this.

Code:
<body onLoad="MM_preloadImages('image1.jpg','image2.jpg','image3.jpg');"
Doing this makes it really easy to dynamically specify all the images you are going to need.

Top
#18574 - 10/21/02 02:42 AM Re: preload images
Joined: Apr 2002
Posts: 730
Moffesto Offline
UGN Supporter
Moffesto Offline
UGN Supporter

Joined: Apr 2002
Posts: 730
Kuntucky
i dont know shit about javascript... i can just configure it alil but other than that... im lost. Do u put the first part in the head and the second in the body or what?


2 people can keep a secret as long as one is dead
Top
#18575 - 10/21/02 11:44 AM Re: preload images
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox Offline
Junior Member

Joined: Oct 2002
Posts: 37
For mine? You'd just do what BackSlash did up there at first with the head and javascript tags. Then the body part would go with the body tag.

Top
#18576 - 10/21/02 07:39 PM Re: preload images
Joined: Mar 2002
Posts: 599
BackSlash Offline
UGN's Resident Homo
BackSlash Offline
UGN's Resident Homo

Joined: Mar 2002
Posts: 599
TN
mines easier :p


"It's better to burn out, than to fade away."
Top
#18577 - 10/22/02 04:18 PM Re: preload images
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox Offline
Junior Member

Joined: Oct 2002
Posts: 37
Not if you are making it dynamic!

Top
#18578 - 11/05/02 11:11 PM Re: preload images
Joined: Mar 2002
Posts: 143
olosoft Offline
Member
olosoft Offline
Member

Joined: Mar 2002
Posts: 143
.
uhh, yes, because you wrote that code yourself ReverendNinjaSox. its not at all the code that macromedia dreamweaver generates for you. MM_preloadImages. *sigh*

Top
#18579 - 11/06/02 06:38 PM Re: preload images
Joined: Oct 2002
Posts: 37
ReverendNinjaSox Offline
Junior Member
ReverendNinjaSox Offline
Junior Member

Joined: Oct 2002
Posts: 37
Oo. Good call. I didn't do the javascript. I do the perl that lies behind it.

Top

Member Spotlight
Crime

Crime
SC, usa
Posts: 506
Joined: March 2002
Show All Member Profiles 
Forum Statistics
Forums46
Topics46,185
Posts81,355
Members2,157
Most Online1,567
Apr 25th, 2010
Top Posters(All Time)
UGN Security 39,349
Gremelin 7,195
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Newest Members
Herbert_Sherbert, codemauve, Lillysdragon1984, Brewwit, boa
2157 Registered Users
Who's Online Now
0 registered members (), 0 guests and 1 spider.
Latest News