11
मैं एक समारोह की जरूरत को चलाने के लिए जब एक divs डेटा-पेज सूचकांक विशेषता बदलता हैjQuery घटना
var active = $('.swipeview-active'),
dpi = parseInt(active.attr('data-page-index')),
left = $('[data-page-index="' +prev+ '"]').children("img").eq(0),
right = $('[data-page-index="' +next+ '"]').children("img").eq(0);
$(active.attr('data-page-index')).change(function(){
right.clone(true). css({'z-index': 5}). fadeIn(2000).appendTo('#right');
left.clone(true). css({'z-index': 5}). fadeIn(2000).appendTo('#left');
});
मैं परिवर्तन() फ़ंक्शन की कोशिश की लेकिन केवल इनपुट क्षेत्रों के साथ काम करने के लिए लगता है कि,
$(active.attr('data-page-index')).change(function(){
क्या यह प्राप्त करने का एक और तरीका है? धन्यवाद।
मैं इस दूसरे दिन, http://meetselva.github.io/attrchange/ सुंदर सभ्य प्लगइन का इस्तेमाल किया। – christoshrousis
यहां उत्तर दें http://stackoverflow.com/questions/16781778/detecting-attribute-change-of-value-of-an-attribute-i-made –