我有一个没有在jQuery mobile中触发事件的按钮。它工作,但我不得不删除CSS。它搞砸了我所有的ul列表。任何帮助将非常感谢
以下是表单底部按钮的代码:
<div class="next">
<a class="btnNext">Next >></a>
</div>
应该在单独的js文件中执行此操作:
init: function(){
$('.btnNext').onclick(function(){
if ($('input[type=radio]:checked:visible').length == 0) {
return false;
}
$(this).parents('.questionContainer').fadeOut(500, function(){
这是我删除的CSS:
a {
border: 1px solid #000;
padding: 2px 5px;
font-weight: bold;
font-size: 10px;
background: #FFF;
cursor: pointer;
}
a:hover {
background: none;
}
答案 0 :(得分:0)
试试这个:
//You need use $('.btnNext').live('click',function(){ or $('.btnNext').click(function(){
$('.btnNext').live('click',function(){
if ($('input[type=radio]:checked:visible').length == 0) {
return false;
}
//your other code
});