Bootstrap switch checked event?

前端 未结 9 1542
感情败类
感情败类 2021-01-31 14:48

I use this codes for checkbox checked event but it does not work.

css



        
9条回答
  •  孤独总比滥情好
    2021-01-31 15:40

    Note: The bootstrap docs now use the second example.

    For bootstrap-switch 3.0 release candidate the event previously given as an example on the official page was:

    $('#switch-change').on('switchChange', function (e, data) {}); 
    

    It doesn't get fired!

    Solution - use this instead :

    $('#switch-change').on('switchChange.bootstrapSwitch', function (event, state) {}); 
    

    where state parameter is the value of the checkbox.

提交回复
热议问题