25
rated 0 times
[
31]
[
6]
/ answers: 1 / hits: 16846
/ 11 Years ago, tue, june 18, 2013, 12:00:00
I need to detect some class changing, i use for this DOMAttrModified, but something is wrong, what?
var first_img = $('body').find('li:first').find('img');
first_img.on('DOMAttrModified',function(e){
if (e.attrName === 'class') {
if ($(this).hasClass('current-image')) {
$(this).removeClass().addClass('previous-image');
}
console.log('log');
}
});
Thx for advice.
More From » jquery