语义ui复选框奇怪的bahaviour

时间:2015-07-14 16:26:39

标签: jquery css semantic-ui

我正在尝试使用Semantic Ui复选框,但它表现得很奇怪。您必须单击复选框中的某个位置,以使其背景更改颜色,而不管状态

[https://jsfiddle.net/6393n6e9/][1]

它在同一浏览器中的Semantic Ui网站上运行正常

[http://semantic-ui.com/modules/checkbox.html#/definition][2]

我错过了什么?

1 个答案:

答案 0 :(得分:0)

我没有将语义包包含在小提琴中,但是在你的开发环境中,你必须像这样初始化复选框:

// this will affect all elements that have the classes ui & checkbox
$('.ui.checkbox').checkbox();

// this will only affect the one you need, if it has any id specified
$('#myCheckbox').checkbox();

还要确保语义ui文件已正确加载,并查找拼写错误(这让我上一次,哈哈)

相关问题