1. Как перехватить событие "onload" для изображения.
var tempImage = $E('img', {src: 'http://nnn.jpg'})
tempImage.onload(function(){...})
2. Каким образом получить ссылку на 'element' в событии Fx ->
onFinish:
element.morph({ ... },{onFinish: function(){ . . . }})
Спасибо!
RightJS works with something called dom-wrappers, when you make a call like `new Element` or `$E(` or just `$('something')` it returns you a javascript object that represents your dom-element, but that's not the actual element. The element is referred by using the the `._` attribute. For example
var el = $E('div');
console.log(el); // will show the RightJS dom-wrapper object
console.log(el._); // will show the actual raw dom-element
So, to answer your question, you should either use RightJS `.on(` method, like nicksan suggested
var el = $E('img');
el.on('load', function() {...});
el.set('src', 'some-image.jpg');
That is preferred and less troublesome solution. But, if you feel particularly evil, you can assign that function directly as you initially tried.
var el = $E('img');
el._.onload = function() {
console.log("kids, don't do that");
};
I hope, that helps
> --
> You received this message because you are subscribed to the Google Groups "RightJS" group.
> To post to this group, send email to rig...@googlegroups.com.
> To unsubscribe from this group, send email to rightjs+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rightjs?hl=en.
>