javascript - mootools fire click event. How to pass own data? -
i have click event parent element , delegated event children. however, want able fire click , pass in simulated click event's information event listener.
$('rt-main').addevent('click:relay(.catclick)', function(e){ e.stop(); new request({ method: 'get', url: 'index.php?option=com_categories&tmpl=component&view=listing&cat=' + this.get('id'), oncomplete: function(response){ $('rt-main').set('html', response); } }).send(); }); // here want fire event. how pass in 'id' of choosing? // know particular line fires first anchor. how target // psuedo-anchor? or better target class? $('rt-main').fireevent('click', {target: $('rt-main').getelement('a'), stop: function.from} );
dimitar correct. pass id: "data"
in arguments, , add check in event handler passed in data.
here's jsfiddle: http://jsfiddle.net/jt7mg/
Comments
Post a Comment