Code Monkey home page Code Monkey logo

jquery.onoff's Issues

Minimal problem with the callbacks

Hey, thanks at all for this cool thing,
my problem is followed. Every time I try to get a callback, the console gave me that issue:
Uncaught ReferenceError: $input is not defined

I did all that in the tut from Github, but doesnt work. In your example HTML-File also...
Hope you can help me as soon as possible.

Regards muuvmuuv

Change switch sate does not set checked state.

I tried the master version and the online sample. When I click the toggle, the checked state does not change in HTML. I set $input.attr('checked', true), the toggle does not change either.

jQuery 3.x

Does this work with jquery 3.x? It has not been updated in few years

proto.io generated html is wrong

The generated html from http://proto.io/freebies/onoff/ is providing the following snippet:

<div class="onoffswitch">
    <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch">
    <label class="onoffswitch-label" for="myonoffswitch">
        <span class="onoffswitch-inner"></span>
        <span class="onoffswitch-switch"></span>
    </label>
</div>

where the correct one (also mentioned in your README) is:

<div class="onoffswitch">
  <input type="checkbox" class="onoffswitch-checkbox" id="myonoffswitch" />
  <label class="onoffswitch-label" for="myonoffswitch">
    <div class="onoffswitch-inner"></div>
    <div class="onoffswitch-switch"></div>
  </label>
</div>

The difference is the div instead of span inside the label that prevented the plugin to properly figure out how to render itself.

Not able to switch state

I have multiple checkboxes with the plugin enabled. I wanna do something like;

$(document).on('click', '#everything', function(){

    $.ajax({
        type: 'POST',
        url: '/toggle-all',
                complete: function() {
                    // toggle all to active state....
                   alert(' all checkboxes  active in state');
                    $('.onoffswitch-checkbox').something();
        }
    });
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.