If you have an image element with id MyElement, you can access it thus:

$('MyElement')

And you can attach the even to it like this:

$('MyElement').addEvent('load', function(){ alert('loaded my image') });

If you have to repeat that for lots of images, you could add the event to each image using $$ to return a list of elements (in the Core docs under 'dollars'). Or you could take a look at 'relay' - but let's get it working for one image first.

HTH
Lee

On 01/02/2011 15:19, Steve Onnis wrote:

Yup

I have tried

$("image-list").getElements("img").addEvent("load", function() {})

*From:*Lee [mailto:[email protected]]
*Sent:* Wednesday, 2 February 2011 1:17 AM
*To:* [email protected]
*Subject:* Re: [Moo] fire an even when an image has loaded without using Assets

Have you tried addEvent('load', function(){ ... })

On 01/02/2011 14:55, Steve Onnis wrote:

Is it possible to fire an even when an image has loaded without using the Assets library? I just want to run a function onload for images.....

Failing that...an easy way to do it with Assets. I don't need to define individual image Asset items as all images will use the same onload function

Steve






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.21, Virus/Spyware Database: 6.16810)
http://www.pctools.com <http://www.pctools.com/?cclick=EmailFooterClean_51>
=======






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.21, Virus/Spyware Database: 6.16810)
http://www.pctools.com <http://www.pctools.com/?cclick=EmailFooterClean_51>
=======






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.21, Virus/Spyware Database: 6.16810)
http://www.pctools.com <http://www.pctools.com/?cclick=EmailFooterClean_51> =======

Reply via email to