这篇文章给大家分享的是有关switchery按钮怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。1.先引入switchery.css 和 switchery.js2.绘制 c
这篇文章给大家分享的是有关switchery按钮怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
1.先引入switchery.css 和 switchery.js
2.绘制 checkbox按钮 : a.静态页面写法 未选中时 <input type="checkbox" class="js-switch_3" /> 选中时 <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 中处理,是按钮有点击效果。
当页面中只有一个checkbox 时:var elem = document.querySelector(".js-switch") var switchery= new Switchery( elem,{color : '#f8ac59'}).
当有多个时:var elem = document.querySelector(".js-switch")
$.each(funtion (num) { var switchery = new Switchery(this, { color: '#1AB394', className: 'switchery-small' });}) ;
感谢各位的阅读!关于“switchery按钮怎么用”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
--结束END--
本文标题: switchery按钮怎么用
本文链接: https://www.lsjlt.com/news/77557.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
2022-06-04
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0