Previous Thread
Next Thread
Print Thread
Rate Thread
#18569 10/15/02 08:53 PM
Joined: Apr 2002
Posts: 730
UGN Supporter
OP Offline
UGN Supporter
Joined: Apr 2002
Posts: 730
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
#18570 10/16/02 03:22 AM
Joined: Oct 2002
Posts: 21
Junior Member
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:

<IMG SRC="/path/to/image" HEIGHT="48" WIDTH="48" ALT="My Image">

The 48 is in pixels.

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

#18571 10/16/02 06:45 PM
Joined: Apr 2002
Posts: 730
UGN Supporter
OP Offline
UGN Supporter
Joined: Apr 2002
Posts: 730
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
#18572 10/16/02 11:26 PM
Joined: Mar 2002
Posts: 599
UGN's Resident Homo
Offline
UGN's Resident Homo
Joined: Mar 2002
Posts: 599
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."
#18573 10/17/02 08:17 PM
Joined: Oct 2002
Posts: 37
Junior Member
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.

#18574 10/20/02 07:42 PM
Joined: Apr 2002
Posts: 730
UGN Supporter
OP Offline
UGN Supporter
Joined: Apr 2002
Posts: 730
i dont know [censored] 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
#18575 10/21/02 04:44 AM
Joined: Oct 2002
Posts: 37
Junior Member
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.

#18576 10/21/02 12:39 PM
Joined: Mar 2002
Posts: 599
UGN's Resident Homo
Offline
UGN's Resident Homo
Joined: Mar 2002
Posts: 599
mines easier :p


"It's better to burn out, than to fade away."
#18577 10/22/02 09:18 AM
Joined: Oct 2002
Posts: 37
Junior Member
Offline
Junior Member
Joined: Oct 2002
Posts: 37
Not if you are making it dynamic! smile

#18578 11/05/02 04:11 PM
Joined: Mar 2002
Posts: 143
Member
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*

#18579 11/06/02 11:38 AM
Joined: Oct 2002
Posts: 37
Junior Member
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.


Link Copied to Clipboard
Member Spotlight
Posts: 30
Joined: June 2002
Forum Statistics
Forums41
Topics33,840
Posts68,858
Average Daily Posts1
Members2,176
Most Online3,253
Jan 13th, 2020
Latest Postings
Where and how do you torrent?
by danni75 - 03/01/24 05:58 AM
Animation,
by JohanKaariainen - 08/15/19 01:18 AM
Blackbeard.....
by Gremelin - 10/03/18 07:02 PM
my old account still exists!
by Crime - 08/10/18 02:47 PM
Okay WTF?
by HenryMiring - 09/27/17 01:45 AM
The History Thread...
by Gremelin - 08/11/17 12:11 PM
My friend NEEDS your HELP!
by Lena01 - 07/21/17 12:06 AM
I'm having fun with this guy.
by gabithompson730 - 07/20/17 01:50 AM
I want to upgrade my phone
by gabithompson730 - 07/20/17 01:49 AM
Doom 3
by Cyrez - 09/11/14 08:58 PM
Amazon Gift Card Generator/KeyGen?te
by Gecko666 - 08/22/14 09:21 AM
AIM scene 99-03
by lavos - 09/02/13 08:06 AM
Planetside 2
by Crime - 03/04/13 07:10 AM
Beta Testers Wanted
by Crime - 03/04/13 06:55 AM
Hello Everyone
by Gremelin - 02/12/12 06:01 PM
Tracfone ESN Generator
by Zanvin Green - 01/18/12 01:31 PM
Python 3 issue
by Testing - 12/17/11 09:28 PM
tracfone airtime
by Drache86 - 07/30/11 03:37 AM
Backdoors and the Infinite
by ZeroCoolStar - 07/10/11 03:52 AM
HackThisZIne #12 Releaseed!
by Pipat2 - 04/28/11 09:20 PM
gang wars? l33t-wars?
by Gremelin - 04/28/11 05:56 AM
Consolidate Forums
by diggin2deep - 04/21/11 10:02 AM
LAN Hacking Noob
by Gremelin - 03/12/11 12:42 AM
Top Posters
UGN Security 41,392
Gremelin 7,203
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
Crime 1
Ice 1
Dartur 1
Cyrez 1
Powered by UBB.threads™ PHP Forum Software 7.7.5