Easy Custom Radio Button Plugin With jQuery custom radio - Download Easy Custom Radio Button Plugin With jQuery - custom-radio

Download Easy Custom Radio Button Plugin With jQuery – custom-radio

Posted on

This time I will share jQuery Plugin and tutorial about Easy Custom Radio Button Plugin With jQuery – custom-radio, hope it will help you in programming stack.

Easy Custom Radio Button Plugin With jQuery custom radio - Download Easy Custom Radio Button Plugin With jQuery - custom-radio
File Size: 7.09 KB
Views Total: 2090
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   



custom-radio is a minimal jQuery plugin which converts normal radio buttons into inline labels for easier selection.

How to use it:

1. Load the jQuery custom-radio plugin after loading jQuery JavaScript library as follows:

1 <script src="//code.jquery.com/jquery-2.2.0.js"></script>
2 <script src="custom-radio.js"></script>

2. Wrap the default radio buttons into a DIV element.

1 <div data-radio-custom>
2   <input type="radio" name="material" value="Steel">
3   <input type="radio" name="material" value="Silver">
4   <input type="radio" name="material" value="Gold">
5 </div>

3. Initialize the plugin by calling the function on the DIV element.

1 $('div[data-radio-custom]').customRadio();

4. Style the plugin with your own CSS styles.

01 label {
02   float: left;
03   width: 100px;
04   background-color: #DEDEDE;
05   border-radius: 4px;
06   padding: 10px;
07   margin-right: 20px;
08   text-align: center;
09 }
10  
11 label.selected {
12   color: #fff;
13   background-color: #17bed0;
14 }

5. Default plugin options.

01 $('div[data-radio-custom]').customRadio({
02  
03   // custom label text
04   text: 'value',
05  
06   // custom css class
07   customClass: '',
08  
09   // disabled radio button
10   disabled: false,
11  
12   // destroy the plugin
13   destroy: false
14    
15 });

This awesome jQuery plugin is developed by mario-iliev. For more Advanced Usages, please check the demo page or visit the official website.




source : jqueryscript.net