Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Image Pre-load
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Commsman
Practical

United Kingdom
40 Posts

Posted - 18 Apr 2005 :  09:42:29  Show Profile  Visit Commsman's Homepage  Reply with Quote
Hi
What is the easiest way to pre-load images which are going to be called by events in the page? The images are not to be shown until the events are triggered, but I don't want the visitor to my site to wait while the image is downloaded - it should already have been loaded using for example script called from a body onload parameter (the same way Dreamweaver handles it for example):
Dreamweaver usually does something like:
<body onLoad="MM_preloadImages('image1.gif','image2.jpg','image3.gif')">

and the JavaScript used is:

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; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

Is there an easy way to do this in Dynamic HTML Editor or do I have to do it by hand? I would then embed this script in the page (although it would be better as an external file if many pages were going to use the function) and try to remember what the image names are going to be for each page. Or could this be a system which could be done automatically by Dynamic HTML Editor?

Chers
Julian

s.dav
Site Admin

Italy
3364 Posts

Posted - 18 Apr 2005 :  11:48:13  Show Profile  Visit s.dav's Homepage  Reply with Quote
Dynamic HTML Editor already preload hidden images (those used by events and rollover)!
Set for example a rollover effect over an image and try to view the page source!

Regards, Davide
Go to Top of Page

Commsman
Practical

United Kingdom
40 Posts

Posted - 19 Apr 2005 :  10:39:43  Show Profile  Visit Commsman's Homepage  Reply with Quote
Great - sorry I did not spot the code to do this
I have registered now - this is excellent software.
Regards
Julian
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000