Giter Club home page Giter Club logo

radiocharm's Introduction

Radiocharm

A lightweight jQuery plugin that gives charm to radio boxes and allows custom labels, icons, and ability to un-check selection by clicking again on the selected radio box.

Demo / Examples

Radiocharm Demo / Examples

Usage

Default Implementation

Default implementation using data-radiocharm-label as the label for each option.

<input data-radiocharm-label="Label Here" type="radio" />
$(document).ready(function(){
  $('input:radio').radiocharm();
});

Background Color Implementation

Background color implementation using data-radiocharm-background-color to change the background colors for each option. Additionally, you can use data-radiocharm-text-color if you need to change the color of the text.

<input data-radiocharm-label="Label Here" data-radiocharm-background-color="c9302c" type="radio" />
$(document).ready(function(){
  $('input:radio').radiocharm();
});

Icon Implementation

Icon implementation using data-radiocharm-icon to change the icon for each option.

<input data-radiocharm-label="Label Here" data-radiocharm-icon="thumbs-up" type="radio" />
$(document).ready(function(){
  $('input:radio').radiocharm();
});

Uncheckable Implementation

Uncheckable implementation using uncheckable setting to be passed over on initialization. Default is false.

<input data-radiocharm-label="Label Here" type="radio" />
$(document).ready(function(){
  $('input:radio').radiocharm({
    uncheckable: true
  });
});

Dependencies

Font Awesome

Font Awesome gives you scalable vector icons that can instantly be customized - size, color, drop shadow, and anything that can be done with the power of CSS.

<link href="https://opensource.keycdn.com/fontawesome/4.7.0/font-awesome.min.css" rel="stylesheet" />

radiocharm's People

Contributors

tetrissmalls avatar

Stargazers

 avatar

Watchers

 avatar

radiocharm's Issues

How to handle "change" event?

Hi. Great lib. But I have a problem with handling of "change" event. "change" handler is never called. Here my code:

$('#leme').radiocharm();
$('#leme').change(function(e) {
    console.log(e);
});

I checked the source code and find, that original element meant to be replaced by the lib element. So, my handler cannot be called on original element. However, the lib triggers "change" event for non-understandable reason (jquery-radiocharm.js:108):
$('input#radiocharm-' + input_id).trigger('change');

So, the main question, how can I handle change event for the radiobuttons in this lib?

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.