Coder Social home page Coder Social logo

jquery-vtoggler's Introduction

UJS CheckBox Visibility Toggler

A jQuery extension thats allows a input check box to show or hide other side elements depending on if it is checked or not. It uses unobtrusive JavaScript via HTML5 compatible attributes.

Example:

<input type="checkbox" data-vtoggle="#container" />

The check box above toggle the visibility of element "#container". If the check box is not checked the container will be hidden.

Second example:

<input type="checkbox" data-vtoggle-hide="img, .hide-with-images"  />

This check box will hide all IMG-tags and all element with the CSS class "hide-with-images" when check box is checked.

This plugin can also be used to create own check box handler by using the checkboxToggle function added to jQuery:

$(element).checkboxToggle(function(checked) {
  ...
});

Another helper can be used to simply set the visibility of an element:

$(element).setVisibility(true);

License

MIT License. Copyright (C) 2011 Jan Graichen

jquery-vtoggler's People

Contributors

jgraichen avatar

Watchers

 avatar James Cloos avatar  avatar

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.