त्वरित सवाल लोगों टॉगल, मैं इस.on() और यहाँ एक साथ काम करने
$('#wrap').on('toggle', '#image', function(){
<!-- Do stuff -->
});
इसके अंदर एक टॉगल करने के लिए सक्षम होने के लिए प्राप्त करने के लिए नहीं कर सकते लगता है? कोई विचार? मैंने googling कोशिश की है लेकिन कोई भाग्य के साथ।
इस, कोड मैं .on के साथ काम करने की कोशिश कर रहा हूँ वर्तमान में यह तत्व पुत्र पेज, के सभी
$("#result_options").toggle(function() {
var image_width = $('#image').width()/2;
var brick_width = $('#brick').width()/2;
$("#image").css("width",image_width);
$("#image").css("padding","4px");
$("#brick").css("width",brick_width);
},function(){
$("#image").css("width","300");
$("#image").css("padding","8px");
$("#brick").css("width","314");
$(this).html("Smaller Results");
});
});
(#image और #brick है) में परिवर्तन लागू नहीं होता है के रूप में
के संभावित डुप्लिकेट [ टॉगल ईवेंट के साथ jQuery .live का उपयोग करना] (http://stackoverflow.com/questions/2172614/using-jquery-live-with-toggle-event) – j08691