开发者

jQuery SlideToggle on checkbox

开发者 https://www.devze.com 2023-04-06 12:22 出处:网络
I currently have this working with a button.How do I switch display/hide to work with a Checkbox? $(document).ready(function(){

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();
 });
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号