Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/405.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 当状态从';更改时,引导开关更改事件不触发;假';至';正确';动态地_Javascript_Jquery_Twitter Bootstrap_Bootstrap Switch - Fatal编程技术网

Javascript 当状态从';更改时,引导开关更改事件不触发;假';至';正确';动态地

Javascript 当状态从';更改时,引导开关更改事件不触发;假';至';正确';动态地,javascript,jquery,twitter-bootstrap,bootstrap-switch,Javascript,Jquery,Twitter Bootstrap,Bootstrap Switch,我在项目中使用来显示警告标志。每次我尝试动态地将switch的值从false设置为true时,它都不会进入.bootstrapSwitch().on方法。它可以动态地将开关状态从false更改为true。在下面拉小提琴- 将第三个参数设置为false,它就会工作 $('#toggleSwitchOn').click(function () { $('#bootstrapswitch').bootstrapSwitch('state', true, false); }); 将第三个参数设

我在项目中使用来显示警告标志。每次我尝试动态地将switch的值从false设置为true时,它都不会进入
.bootstrapSwitch().on
方法。它可以动态地将开关状态从false更改为true。在下面拉小提琴-


将第三个参数设置为false,它就会工作

$('#toggleSwitchOn').click(function () {
    $('#bootstrapswitch').bootstrapSwitch('state', true, false);
});

将第三个参数设置为false,它就会工作

$('#toggleSwitchOn').click(function () {
    $('#bootstrapswitch').bootstrapSwitch('state', true, false);
});

将第三个参数设置为false,它就会工作

$('#toggleSwitchOn').click(function () {
    $('#bootstrapswitch').bootstrapSwitch('state', true, false);
});

将第三个参数设置为false,它就会工作

$('#toggleSwitchOn').click(function () {
    $('#bootstrapswitch').bootstrapSwitch('state', true, false);
});

单击“关闭”,它会发出错误警报。现在单击“On”,它不会提醒$(#bootstrapswitch')。bootstrapswitch('state',false,false)$(#bootstrapswitch')。bootstrapswitch('state',true,true);单击“关闭”,它将发出错误警报。现在单击“On”,它不会提醒$(#bootstrapswitch')。bootstrapswitch('state',false,false)$(#bootstrapswitch')。bootstrapswitch('state',true,true);单击“关闭”,它将发出错误警报。现在单击“On”,它不会提醒$(#bootstrapswitch')。bootstrapswitch('state',false,false)$(#bootstrapswitch')。bootstrapswitch('state',true,true);单击“关闭”,它将发出错误警报。现在单击“On”,它不会提醒$(#bootstrapswitch')。bootstrapswitch('state',false,false)$(#bootstrapswitch')。bootstrapswitch('state',true,true);我不理解这背后的逻辑方法状态可以接收可选的第三个参数跳过。如果为true,则不执行switchChange事件。默认值为false。我需要其他东西,$(this).bootstrapSwitch({onSwitchChange:function(e,state){if(state==false){//do something}其他{//do something}});还有,我需要打开开关!我不理解这背后的逻辑方法状态可以接收可选的第三个参数跳过。如果为true,则不执行switchChange事件。默认值为false。我需要其他东西,$(this).bootstrapSwitch({onSwitchChange:function(e,state){if(state==false){//do something}其他{//do something}});还有,我需要打开开关!我不理解这背后的逻辑方法状态可以接收可选的第三个参数跳过。如果为true,则不执行switchChange事件。默认值为false。我需要其他东西,$(this).bootstrapSwitch({onSwitchChange:function(e,state){if(state==false){//do something}其他{//do something}});还有,我需要打开开关!我不理解这背后的逻辑方法状态可以接收可选的第三个参数跳过。如果为true,则不执行switchChange事件。默认值为false。我需要其他东西,$(this).bootstrapSwitch({onSwitchChange:function(e,state){if(state==false){//do something}其他{//do something}});还有,我需要打开开关!