Quick question here guys, I cant seem to get this
$('#wrap').on('toggle', '#image', function(){
<!-- Do stuff -->
});
to be able to have a toggle inside it? Any ideas? I have tried googling but with no luck.
this is the code i am trying to get to work with .on, as currently it doesn't apply the changes to all of the element son the page, (that have #image and #brick)
$("#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");
});
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…