欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

switchery按鈕的使用方法

 更新時(shí)間:2017年12月18日 13:57:03   作者:弋淼女孩  
下面小編就為大家分享一篇switchery按鈕的使用方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧

1.先引入switchery.css 和 switchery.js

2.繪制 checkbox按鈕 : a.靜態(tài)頁(yè)面寫法  未選中時(shí) <input type="checkbox" class="js-switch_3"  />        選中時(shí)  <input type="checkbox" class="js-switch_4" checked /> 

 

b.C# 寫法 (1) @Html.CheckBoxFor(m => m.Active, new { @Class = "js-switch", @checked = Model.Active }) <span> Activate</span>

(2) @Html.CheckBox("edit_forMave_" + i, new { @class = "js-switch", @checked = true })

3. script 中處理,是按鈕有點(diǎn)擊效果。

當(dāng)頁(yè)面中只有一個(gè)checkbox 時(shí):var elem = document.querySelector(".js-switch")   var switchery= new Switchery( elem,{color : '#f8ac59'}).

當(dāng)有多個(gè)時(shí):var elem = document.querySelector(".js-switch") 

$.each(funtion (num) { var switchery = new Switchery(this, { color: '#1AB394', className: 'switchery-small' });}) ;

以上這篇switchery按鈕的使用方法就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論