2011年12月21日 星期三

Bind HTML image to click event

1. Add class to element


2. bind to listeners

//select all element img with class 'enlarge' and bind to listeners
Ext.select('img.enlarge').on( 'click', function() {
    //action when image is clicked
});

Or, get bind using element ID
Ext.get('myImage').on(.....);

沒有留言:

張貼留言