Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Javascript or css preloading of images?

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert Email Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Martin1 Posted - 26 Jan 2008 : 19:30:03
Which would be better? The javascript way of pre loading images or the css way.
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from none JavaScript Browsers

Image1= new Image(175,50)
Image1.src = "image1.gif"

Image2 = new Image(25,30)
Image2.src = "image2.gif"

Image3 = new Image(125,80)
Image3.src = "image3.gif"

// End Hiding -->
</SCRIPT>

or css

<style type="text/css">
.hiddenPic {display:none;}
</style>

<img src="poodle-puppy-Clara.jpg"
alt="Clara at 8 weeks" title="Clara at 8 weeks"
height="350" width="350" class="hiddenPic">


<img src="poodle-puppy-Kenny.jpg"
alt="Kenny at 10 weeks" title="Kenny at 10 weeks"
height="350" width="350" class="hiddenPic">


<img src="poodle-puppy-Aiko.jpg"
alt="Aiko at 6 weeks" title="Aiko at 6 weeks"
height="350" width="350" class="hiddenPic">


Martin
1   L A T E S T    R E P L I E S    (Newest First)
jtarin Posted - 28 Jan 2008 : 03:59:55
Here's a link that gives some insight on the pro and cons as to both method, with a preference to CSS. Javascript...plenty of scripts available and fast. CSS....good for browsers that turn Javascript off.
http://www.ilovejackdaniels.com/css/preloading-images-with-css/

Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000