I am creating a widget in dojo that enlarges the thumbnail on mouse over.
The widget binds the mouseover event with all thumbnails in the constructor like this:
dojo.connect(imgTag, "mouseover", this, "_showImgPreview");
In _showImgPreview() I need the image on which mouse over event occurred. By doing above I am only getting the event and not the image.
How can I get the thumbnail on which event occurred in _showImgPreview()?
I know I can do like this but I am interested in knowing how can I do it using the method mentioned above.
var self = this;
dojo.connect(imgTag, "mouseover", function(e){
self._showImgPreview(e, this);
});
Thank you in advance!
e.targetwill be the imgTag.If you are inside a class that is extending Widget, you can use
If you are not, you can use
Note:
dojo/connecthas been deprecated in favor ofdojo/on