473,748 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

explain the "new Image();"

Currently using the "document.image s" to "preload" images - not for
future pages, but for the page being loaded. I got it from
http://www.dynamicdrive.com/dynamici...agetooltip.htm

Its a nice script - pops up an img on mouseover.

I understand that its downloading SOMETHING - but its not rendering....

THE QUESTION: How does "preloading " these images (into cache, as I have
read) affect page size, page load, etc. I cannot find anything
specific regarding this.
CODE EXAMPLE:
if (document.image s) {
var theImgs = new Array();
for (var i=0; i<messages.leng th; i++) {
theImgs[i] = new Image();
theImgs[i].src = "myimg.jpg" ;
}
}

Jun 16 '06 #1
1 2010

mm*****@gmail.c om wrote:
Currently using the "document.image s" to "preload" images - not for
future pages, but for the page being loaded. I got it from
http://www.dynamicdrive.com/dynamici...agetooltip.htm

Its a nice script - pops up an img on mouseover.

I understand that its downloading SOMETHING - but its not rendering....

THE QUESTION: How does "preloading " these images (into cache, as I have
read) affect page size, page load, etc. I cannot find anything
specific regarding this.
CODE EXAMPLE:
if (document.image s) {
var theImgs = new Array();
for (var i=0; i<messages.leng th; i++) {
theImgs[i] = new Image();
theImgs[i].src = "myimg.jpg" ;
}
}


The images will cause the page to show the loading... gizmo in the
status bar until everything is preloaded, but if you preload in an
onload handler (rather than freestanding within script tags) the page
will display without waiting on the images to download. However, while
the images are downloading, all JS events are suspended in most
browsers. So if someone has dialup and you try to prefetch a large
image, and they mouse over a dynamic menu (for example) the menu
options won't display until the image finishes downloading. I don't
know how many browsers this affects, though.

Jun 17 '06 #2

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

Similar topics

5
3049
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove event to keep the ghost image under the mouse pointer. There are three problems: (1) if the ghost image is dragged so it is partially off the edge of the screen, scrollbars appear. This not only looks bad, it can cause the page to autoscroll...
1
3051
by: Dave | last post by:
Hi all, I was trying to make an image submit button with a rollover and discovered to my suprise that there is no way to access a form element of the "image" type. I tried specifying it by name and also by the elements array with no luck. Even weirder, I can sandwich an image button in between other input types and then write a script diplaying the contents of the elements array and it acts as if the image button does not exist at all!...
2
4231
by: Mr.Clean | last post by:
If I have an Input of type image, it is not listed in the Forms elements when walking to DOM using MSHTML. Is this expected behaviour and how would I get the image input to submit the form NOT using document.form.submit?
2
5531
by: sandman | last post by:
Is this a one-time deal? Or something you want to do programmatically? If it's a one-time thing (e.g. to create a bitmap that you can then use in your program), just press Print-Screen, then load Microsoft PaintBrush and paste. Then you can select/cut/paste what you want and create little control bitmaps. If it's something you want to do in code, sorry, can't help. >-----Original Message----- >
2
2763
by: Alan Silver | last post by:
Hello, If I have the following HTML... <input type="image" src="fred.gif"> .... is there a way to specify the image in CSS rather than in the HTML? TIA
5
7918
by: Mark Woodward | last post by:
Hi all, I'm trying to set up a 'control panel' consisting of a table of icons. The early stages: http://www.deepinit.com/controlcentre.php Each of these is set up like: <td> <input type="image" id="addnews" src="/Image/add24.png"
1
3996
by: oanhhuynh | last post by:
Hi, I'm designing 1 form include 2 Unbound Object Frame to insert image and memo that describe the product. On database in Access have 2 fields image and description with OLE Object property Code on form is : dim strinsert2 strInsert2 = " INSERT INTO products(image,description) values (," & Me.OLEUnbound01 & "," & Me.OLEUnbound02 & ",)"
0
2025
by: tavares | last post by:
(Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co- workers and colleagues.) *************************************************************************** Symposium “Image Processing and Data Visualization” 2nd South-East European Conference on Computational Mechanics (SEECCM 2009) Island of Rhodes, Greece, 22-24 June 2009
1
3187
by: jntmac | last post by:
I cannot find the answer anywhere on the entire net: I have an image on my website. The image shows a newsletter, and the image says "Click here to register to receive our newsletter". I know how to make the image link to a url, but I don't want to do that. What I want to do is when you click on the image, it calls an external javascript function that brings up a popup where you enter your name and email address and submit. The external...
0
8832
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
9562
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9386
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...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
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.