UGN Security Forums
My ProfileMember DirectoryLogin
Search our ForumsView our FAQView our Site Rules
View our CalendarView our Active TopicsGo to our Main Page

UGN Security Store
 

Network Sites UGN Security, The GoNix Initiative, Elite Web Gamers, Back of the Web, EveryDay Helper, VNC Web Design & Development
September
Su M Tu W Th F Sa
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
Sponsored Links
Latest Postings
The History Thread...
by Gremelin
09/18/14 12:42 PM
Doom 3
by Cyrez
09/11/14 11:58 PM
Latest Reviews
Topic Options
Rate This Topic
#18569 - 10/15/02 11:53 PM preload images
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: 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 06:22 AM Re: preload images
Energy Offline
Junior Member

Registered: 10/04/02
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/16/02 09:45 PM Re: preload images
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: 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 02:26 AM Re: preload images
BackSlash Offline
UGN's Resident Homo

Registered: 03/16/02
Posts: 599
Loc: 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/17/02 11:17 PM Re: preload images
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
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/20/02 10:42 PM Re: preload images
Moffesto Offline
UGN Supporter

Registered: 04/22/02
Posts: 730
Loc: 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 07:44 AM Re: preload images
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
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 03:39 PM Re: preload images
BackSlash Offline
UGN's Resident Homo

Registered: 03/16/02
Posts: 599
Loc: TN
mines easier :p
_________________________
"It's better to burn out, than to fade away."

Top
#18577 - 10/22/02 12:18 PM Re: preload images
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
Posts: 37
Not if you are making it dynamic!

Top
#18578 - 11/05/02 06:11 PM Re: preload images
olosoft Offline
Member

Registered: 03/02/02
Posts: 143
Loc: .
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 01:38 PM Re: preload images
ReverendNinjaSox Offline
Junior Member

Registered: 10/03/02
Posts: 37
Oo. Good call. I didn't do the javascript. I do the perl that lies behind it.

Top

Moderator:  §intå×, Gremelin 
Featured Member
Registered: 08/22/14
Posts: 1
Forum Stats
2148 Members
46 Forums
34693 Topics
69863 Posts

Max Online: 1567 @ 04/25/10 05:20 AM
Top Posters
UGN Security 27855
Gremelin 7193
§intå× 3255
SilentRage 1273
Ice 1146
pergesu 1136
Infinite 1041
jonconley 955
Girlie 908
unreal 860
Newest Members
Tim050, Gecko666, defghi795767, Devo60, ali
2148 Registered Users
Who's Online
0 registered (), 323 Guests and 261 Spiders online.
Key: Admin, Global Mod, Mod
Latest News


Donate
  Get Firefox!
Get FireFox!