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/ |
|
|