婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 單選按鈕、多選按鈕用圖片實現加樣式

單選按鈕、多選按鈕用圖片實現加樣式

熱門標簽:電話機器人宣傳片 經綸電銷機器人 華為收費站地圖標注 巫山縣地圖標注app 外呼智能系統報價 個貸電銷機器人 浦東新區百度地圖標注圖片 鄒城智能外呼系統 騰訊植物園地圖標注
之前一直看到有人在問,單選按鈕和多選按鈕怎么加樣式、怎么把按鈕變大?下面把我做的一個例子分享出來。

1.首先把按鈕做成圖片
 

2.html頁面

復制代碼
代碼如下:

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(function(){
$("input[type='checkbox']").click(function(){
if($(this).is(':checked')){
$(this).attr("checked","checked");
$(this).parent().removeClass("c_off").addClass("c_on");
}else{
$(this).removeAttr("checked");
$(this).parent().removeClass("c_on").addClass(" c_off");
}
});
$("input[type='radio']").click(function(){
$("input[type='radio']").removeAttr("checked");
$(this).attr("checked","checked");
$(this).parent().removeClass("r_off").addClass("r_on").siblings().removeClass("r_on").addClass("r_off");
});
});
</script>
</head>
<style>
/* 多選/單選 */
label {
display: block;
cursor: pointer;
line-height: 26px;
margin-bottom: 20px;
width: 26px;
height: 26px;
line-height: 26px;
float: left;
margin-top: 6px;
}
.radios {
padding-top: 18px;
border-top: 1px solid #049CDB;
}
.label_check input, .label_radio input {
margin-right: 5px;
}
.lblby .label_check, .lblby .label_radio {
margin-right: 8px;
}
.lblby .label_radio, .lblby .label_check {
background: url(../images/jxc_btn.png) no-repeat;
}
.lblby .label_check {
background-position: 0 0px
}
.lblby label.c_on {
background-position: 0 -26px;
}
.lblby .label_radio {
background-position: 0 -52px;
}
.lblby label.r_on {
background-position: 0 -78px;
}
.lblby .label_check input, .lblby .label_radio input {
position: absolute;
left: -9999px;
}
</style>
<body class="lblby">
<label for="checkbox-01" class="label_check c_on">
<input type="checkbox" checked="checked" value="1" id="checkbox-01" name="sample-checkbox-01" />
Checkbox1 </label>
<label for="checkbox-02" class="label_check">
<input type="checkbox" value="1" id="checkbox-02" name="sample-checkbox-02" />
Checkbox2</label>
<label for="radio-01" class="label_radio r_on">
<input type="radio" value="1" checked="checked" id="radio-01" name="sample-radio" />
Radio1 </label>
<label for="radio-02" class="label_radio r_off">
<input type="radio" value="1" id="radio-02" name="sample-radio" />
Radio2 </label>
<label for="radio-03" class="label_radio r_off">
<input type="radio" value="1" id="radio-03" name="sample-radio" />
Radio3 </label>
</body>
</html>

標簽:南平 那曲 日喀則 三沙 滁州 楊凌 廣西 唐山

巨人網絡通訊聲明:本文標題《單選按鈕、多選按鈕用圖片實現加樣式》,本文關鍵詞  單選,按鈕,多選,用,圖片,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《單選按鈕、多選按鈕用圖片實現加樣式》相關的同類信息!
  • 本頁收集關于單選按鈕、多選按鈕用圖片實現加樣式的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 库伦旗| 临江市| 沈丘县| 万州区| 读书| 南京市| 吴江市| 乐业县| 尤溪县| 德惠市| 津市市| 普兰店市| 桐柏县| 昌图县| 通山县| 梁河县| 丽江市| 横山县| 壶关县| 温泉县| 梁平县| 于田县| 田阳县| 宣恩县| 万荣县| 专栏| 张家川| 健康| 镇远县| 明溪县| 惠州市| 泸水县| 陇南市| 苏尼特右旗| 余干县| 陆川县| 汉源县| 疏勒县| 阳城县| 台中县| 大埔区|