/    Sign up×
Community /Pin to ProfileBookmark

Purpose of this function

Can anone tell me what this function does?

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];}}
}

Thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@baseiberJan 13.2005 — I believe it has something to do with rollover images.
Copy linkTweet thisAlerts:
@mkdaJan 13.2005 — Many sites use that similar looking code to preload images for mouseovers
Copy linkTweet thisAlerts:
@pj59Jan 13.2005 — It is a js function from macromedia, inserted in pages created by mm software. It is supposed to preload images, the src's of which are passed to the function as arguments (usually onload of the document).

Wherever I see 'MM_whatever' in a code snippet, I tend to think (no offense to those who use such stuff): you will have to take a deeper look into that code because it is created with the "help" of mm.

PJ
Copy linkTweet thisAlerts:
@FunkymonkeyauthorJan 14.2005 — Does anyone know how I'd write a similar piece of code without using mm?
×

Success!

Help @Funkymonkey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...