//打开开关

mui('#mySwitch').switch().toggle();

//小开关打开异常的情况解决办法
$(".mui-switch-handle").attr("style","");

发生Cannot read property 'toggle' of null是因为,执行打开开关需要等页面加载完在执行

写个定时器就可以了

setTimeout(function(){

  mui('#mySwitch').switch().toggle();

  //小开关打开异常的情况解决办法
  $(".mui-switch-handle").attr("style","");

},160);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-11
  • 2022-02-26
  • 2021-05-23
  • 2021-09-27
  • 2022-01-17
  • 2022-03-01
猜你喜欢
  • 2022-12-23
  • 2021-09-30
  • 2021-08-11
  • 2021-07-17
  • 2021-08-16
  • 2021-10-04
相关资源
相似解决方案