What are the numbers in new Image(156,22) ?
Try this... worked for me
var preloadFlag = false;
if (document.images) {
Image11 = new Image
Image22 = new Image
Image33 = new Image
Image44 = new Image
Image55 = new Image
Image66 = new Image
Image77 = new Image
Image11.src = "http://66.165.123.68/a_on.jpg"
Image22.src = "http://66.165.123.68/b_on.jpg"
Image33.src = "http://66.165.123.68/c_on.jpg"
Image44.src = "http://66.165.123.68/d_on.jpg"
Image55.src = "http://66.165.123.68/e_on.jpg"
Image66.src = "http://66.165.123.68/f_on.jpg"
Image77.src = "http://66.165.123.68/g_on.jpg"
preloadFlag = true;
}
Of course you wont need the full url....
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 11, 2005 9:53 PM
To: CF-Talk
Subject: OT: Javascript Image Preloader Question
hola peeps!
the script below is soooo very common, and is supps
to preload images into the browsers cache, and when mousing
over a menu item, it is to flip to the on, you all know this... anyway
when i use it on a new site im building, the images arent preloading.
when i mouse over the images, the browser still pauses for a second, i see
the flag waving @ the top right, and then the image loads, and the mouseover
action, works great. but that sucks. it shouldnt do that. it should
rock n roll
right from the start right?
thanks if you can point me in a good direction...
here is the url, put your mouse over the menu items on the left...
http://66.165.123.68/index.cfml
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from non JavaScript Browsers
Image11= new Image(156,22)
Image11.src = "a_on.gif"
Image22= new Image(156,22)
Image22.src = "b_on.gif"
Image33= new Image(156,22)
Image33.src = "c_on.gif"
Image44= new Image(156,22)
Image44.src = "d_on.gif"
Image55= new Image(156,22)
Image55.src = "e_on.gif"
Image44= new Image(156,22)
Image44.src = "f_on.gif"
Image55= new Image(156,22)
Image55.src = "g_on.gif"
// End Hiding -->
</SCRIPT>
--
tony
Tony Weeg
macromedia certified coldfusion mx developer
email: tonyweeg [at] gmail [dot] com
blog: http://www.revolutionwebdesign.com/blog/
cool tool: http://www.antiwrap.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190033
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54