素材牛VIP会员

jquery表单元素radio和复选按钮checkbox美化特效

 所属分类:网页特效-表单特效,输入/选择框/联动

 浏览:2225次  评论:0次  更新时间:2016-11-17
牛币素材VIP可免积分下载
jquery表单元素radio和复选按钮checkbox美化特效兼容IE6
积分说明:注册即送10牛币,每日签到可获得5牛币,成为VIP会员可永久免牛币下载!   充值积分   充值会员   更多说明»
素材描述:jquery特效用jquery插件制作美化表单中的单选按钮和复选按钮、代码比较简洁调用方便这款插件只适用于单选按钮和复选按钮,提高用户体验。
 标签:表单美化

详细介绍

使用方法:

引入jQuery库文件、特效JS文件

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/prettyCheckboxes.js"></script>

引入CSS样式文件

<link rel="stylesheet" href="css/prettyCheckboxes.css" type="text/css" media="screen" />

特效初始化、参数配置

$(document).ready(function(){
    $('#checkboxDemo input[type=checkbox],#radioDemo input[type=radio]').prettyCheckboxes();
    $('.inlineRadios input[type=radio]').prettyCheckboxes({'display':'inline'});
});

HTML结构

<div id="wrap">
    <form id="checkboxDemo" action="" method="post">
        <fieldset>
            <legend>定制复选框</legend>
            
            <label for="checkbox-1" tabindex="1">项目 1</label>
            <input type="checkbox" name="checkbox-1" id="checkbox-1" value="checkbox-1" />
            <label for="checkbox-2" tabindex="2">项目 2</label>
            <input type="checkbox" name="checkbox-2" id="checkbox-2" value="checkbox-2" />
            <label for="checkbox-3" tabindex="3">项目 3</label>
            <input type="checkbox" name="checkbox-3" id="checkbox-3" value="checkbox-3" />
            <label for="checkbox-4" tabindex="4">项目 4</label>
            <input type="checkbox" name="checkbox-4" id="checkbox-4" value="checkbox-4" />
        
            <label for="checkbox-5" tabindex="5">Check all</label>
            <input type="checkbox" name="checkbox-5" id="checkbox-5" value="checkbox-5" onclick="checkAllPrettyCheckboxes(this,$('#checkboxDemo'))" />
            
            <div class="clear"></div>
            <input type="submit" value="提交内容" id="" />
        </fieldset>
    </form>
    
    <br /><br />
    <form id="radioDemo" action="" method="post">
        <fieldset>
            <legend>定制单选按钮</legend>
            <label for="radio-1" tabindex="1">项目 1</label>
            <input type="radio" name="radio-button" id="radio-1" value="radio-1" />
            <label for="radio-2" tabindex="2">项目 2</label>
            <input type="radio" name="radio-button" id="radio-2" value="radio-2" />
            <label for="radio-3" tabindex="3">项目 3</label>
            <input type="radio" name="radio-button" id="radio-3" value="radio-3" />
            <label for="radio-4" tabindex="4">项目 4</label>
            <input type="radio" name="radio-button" id="radio-4" value="radio-4" />
            <div class="clear"></div>
            <input type="submit" value="提交内容" id="" />
        </fieldset>
    </form>
    <br /><br />
    <form class="inlineRadios" action="">
        <fieldset>
            <legend>插件控制横排显示单选按钮</legend>
            <label for="radio-5" tabindex="1">项目 1</label>
            <input type="radio" name="radio-button-inline" id="radio-5" value="radio-1" />
            <label for="radio-6" tabindex="2">项目 2</label>
            <input type="radio" name="radio-button-inline" id="radio-6" value="radio-2" />
            <label for="radio-7" tabindex="3">项目 3</label>
            <input type="radio" name="radio-button-inline" id="radio-7" value="radio-3" />
            <label for="radio-8" tabindex="4">项目 4</label>
            <input type="radio" name="radio-button-inline" id="radio-8" value="radio-4" />
        </fieldset>
    </form>
</div>

讨论这个素材(0)回答他人问题或分享使用心得会奖励牛币

〒_〒 居然一个评论都没有……

 文明上网,理性发言!   😉 阿里云幸运券,戳我领取
我的牛币余额:0
所需牛币:1 开始下载

牛币获取:签到、评论、充值    » 在线充值(10牛币=1元)