473,703 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Preload Images

Hello,

How can I preload a few images of a page javascript?
Should I use CSS to do this? Is it even possible?

Thanks,
Miguel
Nov 26 '07 #1
9 1964
shapper wrote:
Hello,

How can I preload a few images of a page javascript?
Hi,

Go to google:
http://www.google.com

Type in the searchbox:
preload images javascript

Follow any of the 985,000 links, eg the first.

Regards,
Erwin Moller
Should I use CSS to do this? Is it even possible?

Thanks,
Miguel
Nov 26 '07 #2
Erwin Moller wrote:
shapper wrote:
>How can I preload a few images of a page javascript?

[...]
Go to google:
http://www.google.com

Type in the searchbox:
preload images javascript

Follow any of the 985,000 links, eg the first.
However,

http://groups.google.com

and

preload images group:comp.lang .javascript

returns more useful information.
Please trim your quotes as described in the FAQ Notes.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Nov 26 '07 #3
Thomas 'PointedEars' Lahn wrote:
Erwin Moller wrote:
>shapper wrote:
>>How can I preload a few images of a page javascript?
[...]
Go to google:
http://www.google.com

Type in the searchbox:
preload images javascript

Follow any of the 985,000 links, eg the first.

However,

http://groups.google.com

and

preload images group:comp.lang .javascript

returns more useful information.
Good advise.
>

Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.

Regards,
Erwin Moller
>
PointedEars
Nov 27 '07 #4
Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:19 PM:
Erwin Moller wrote:
>Thomas 'PointedEars' Lahn wrote:
>>Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.

It was four lines that you did not refer to but quoted anyway, and you
did it again. Read the FAQ.
You should try some relaxation techniques. Then you wouldn't stay as
wound up as a two dollar watch.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 27 '07 #5
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:19 PM:
>Erwin Moller wrote:
>>Thomas 'PointedEars' Lahn wrote:
Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.
It was four lines that you did not refer to but quoted anyway, and you
did it again. Read the FAQ.

You should try some relaxation techniques. Then you wouldn't stay as
wound up as a two dollar watch.
I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.

I would like to remind you that you reduce your credibility as the FAQ
maintainer by issuing statements that imply FAQ content not to be important.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Nov 27 '07 #6
Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:40 PM:
Randy Webb wrote:
>Thomas 'PointedEars' Lahn said the following on 11/27/2007 6:19 PM:
>>Erwin Moller wrote:
Thomas 'PointedEars' Lahn wrote:
Please trim your quotes as described in the FAQ Notes.
The two lines from the OP?
Get real.
It was four lines that you did not refer to but quoted anyway, and you
did it again. Read the FAQ.
You should try some relaxation techniques. Then you wouldn't stay as
wound up as a two dollar watch.

I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.
Then I find it necessary to point out that you have posted way more than
those two lines to complain about those two lines. If it had been enough
to have been worthwhile, then sure. But two lines? Wind down my friend.
I would like to remind you that you reduce your credibility as the FAQ
maintainer by issuing statements that imply FAQ content not to be important.
I said the FAQ content isn't important? Wow. You are pedantically
complaining about two lines. I quote a lot more than that, are you going
to start being pedantic with me as well?

Two lines crosses into a gray area where you have to apply some common
sense sometimes and realize it causes more problems to complain than the
two lines ever did.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 28 '07 #7
Thomas 'PointedEars' Lahn wrote:

<snipped for Thomas>
I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.
Hi Thomas,

I have been posting on usenet for ages. You are the first that complains
to me about my posting style. People complaint to me about other things
I wrote a lot, but lets leave that. ;-)
Yes, I know of the conventions you refer to, and I follow them when they
seem to make sense to me. A 2 line question is considered by me very
short and to the point, and I don't see how cutting would increase
readability for anyone with an IQ over 60.

And irritating people?
Me?
Check this very group and see which one of us gets/attracks the most
annoyed reactions...

>
I would like to remind you that you reduce your credibility as the FAQ
maintainer by issuing statements that imply FAQ content not to be important.
This is not the first time I hear you complain out in the open about
Randy being the FAQ maintainer.
Did you had an eye on that task and didn't get it maybe?
I don't know your history, but that returning comment surely makes me think.

Oh: Get happier man. It really helps.

Regards,
Erwin Moller
>

PointedEars
Nov 28 '07 #8
VK
On Nov 26, 2:17 pm, shapper <mdmo...@gmail. comwrote:
Hello,

How can I preload a few images of a page javascript?
Should I use CSS to do this? Is it even possible?
That is a question. Initially in Netscape 3.x they introduced
scriptable .src property for images so developers could achieve roll-
over effects for graphics menu elements. To avoid load delays for the
first mouseover they also introduced Image constructor. The purpose of
this constructor was that by making
var imgOver = new Image;
imgOver.src = 'some/url';
script issued load request for the new image so it would be pre-
cashed. As DOM 0 supported by all - even the most lousy - modern
browsers the answer would be "Yes, it is easy, use Image objects on
page load". But as much as I remember, this feature exposed browsers
to numerous cache misuse, like
var bogusImg = new Image;
bogusImg.src = 'some/10Mb-100Mb/image';
and as I remember some precaution limitation had been made up to stop
caching images completely on imgObject.src=" url" assignments.
What browsers still do such caching and if any left at all is a good
question to check.

P.S. Maybe that would also explain the origin of FAQ 4.31
http://www.jibbering.com/faq/#FAQ4_31 that puzzled me all the time -
because no Web developers in any sanity would ever use server-side CGI
image generators for menu buttons nor would patch content header for
still images. I looked through the clj archives and the time this FAQ
was proposed overall matches to the period of "cache attacks" as my
weaked memory tells me :-) So possibly we have in this FAQ a dog
barking to an all wrong tree.
Nov 28 '07 #9
In comp.lang.javas cript message <47************ **@PointedEars. de>, Wed,
28 Nov 2007 00:40:52, Thomas 'PointedEars' Lahn <Po*********@we b.de>
posted:
>I am quite relaxed, thank you. However, I found it necessary to point out
that Erwin's posting style, which is against established Usenet conventions,
will confuse people, and even irratate some. It was not the first time that
he did this, and it turned out it was not the last time.
Established Usenet convention is to be reasonably tolerant, and not to
reply in a Gestapo-like fashion at any unimportant breach of one's
interpretation of the rules.

One notes that you are evidently found to be similarly arrogant and
obnoxious in de.c.l.j.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demo n.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demo n.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Nov 28 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3656
by: MALdito | last post by:
hi everybody let me say right from the start .. I´m not a coder ... "just" a designer! that said .. here is my question: I´m using dreamweaver´s built in preloader for a menu. it looks like this: function MM_preloadImages() { //v3.0 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;
3
1740
by: Bob | last post by:
I usually use some "pre-load" code in my pages to preload graphics that will be swapped. But, I'm thinking that rather than the long, repetitive, once, for each graphic hardcoded stuff like this: var bb_off = new Image(); bb_off.src = "images/bb_off.jpg"; ....that I could have an array where I just listed the names of the graphics, a loop, and code in the loop that cycles through each entry in the array to create and pre-load the "on"...
2
3384
by: Albert Spencil | last post by:
I have tried several preload scripts found here; plus, some of my own. The only thing that works is the unsophisticated loading of those tiny images. The download consist of 100+ images amounting to 50+mb; and, normally completes in less than 1 minute without preload (using DSL). The preload terminates after 6 or 7 images and seems to time-out in the middle of an image. A reload will download a few more, etc. I have used the <body...
1
3383
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of six slideshows (rather than try to articulate, have a look here): http://www.slack.net/~stacey/stestbed/homejs.jsp Clicking any of the six blocks of text along the sides will begin a loop of the corresponding slideshow.
4
1730
by: shapper | last post by:
Hello, I think to preload an image I should us something like: img = new Image(); img.src = 'images/img.jpg'; Could someone tell me how to create a loop which would preload a list of images? Something like:
4
10360
by: shapper | last post by:
Hello, I am working in Asp.Net 2.0 web sites and I need to preload some images in my master pages and in the pages that use those master pages. Could someone tell me how to do this? Thanks, Miguel
1
2374
by: shapper | last post by:
Hello, Is there a way to preload a few images of a page using only CSS? If yes, how can I do it, and should I use CSS or Javascript to do this? Thanks, Miguel
2
1344
by: matt9807 | last post by:
The following is a script that I have written that preloads images for an image gallery. The problem is that the images only preload in Safari, other browsers load each image when it is called. Any ideas? imgSeries = new Array(); curImg = ''; function loadkill() { document.getElementById('loadingtxt').style.display = "none"; document.getElementById('imgone').src = imgSeries; document.getElementById('imgtwo').src = imgSeries; }
3
1888
by: Revathi Balakrishnan | last post by:
Hi i have the used the below code to switch the button image on mouseover and mouseout. <html:button property="Button" value="Display" styleClass="displaybutton" onmouseover="this.className='displaybutton displaybuttonover'" onmouseout="this.className= 'displaybutton'"/> CSS definition of displaybutton and displaybuttonover is shown below.
0
8750
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8662
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9111
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7853
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4421
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4679
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2439
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2058
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.