Forum Moderators: open
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;
i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
---------
Then, in the body tag you have the preload:
---------
<body onload="MM_preloadimages('/images/image1.jpg','/images/image2.jpg')">
---------
But I don´t want the function calls to be in the file itself, BUT linked to
an extenal js file.
can you PLEASE tell me how to do it? (using this confusing dw
code
Preloading anything takes time of course. You may be better off just quickly downloading the image once your users clickity click. Depends...
Calls must be made during an event. Usually on the page. You could call it off another function, but that would still need to fire off from an event. You could use the onload method but event methods are very buggy across browsers. Why do you need to move it off page?