I currently have this working with a button. How do I switch display/hide to work with a Checkbox?
$(document).ready(function(){
$(".slidingDiv")开发者_如何学C.hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$(".slidingDiv").slideToggle();
});
});
Use the change
event
$('.show_hide').change(function(){
$(".slidingDiv").slideToggle();
});
精彩评论