How to create an on/off switch with Javascript/CSS?

前端 未结 7 454
长情又很酷
长情又很酷 2020-12-04 09:41

I want to have a sliding switch. On the left would be Off and on the right would be On. When the user toggles the switch, I want the \'slider\' portion to slide to the other

相关标签:
7条回答
  • 2020-12-04 10:09

    You mean something like IPhone checkboxes? Try Thomas Reynolds' iOS Checkboxes script:

    Once the files are available to your site, activating the script is very easy:

    ...

    $(document).ready(function() {
      $(':checkbox').iphoneStyle();
    });
    

    Results:

    0 讨论(0)
提交回复
热议问题