【发布时间】:2013-12-29 04:24:58
【问题描述】:
这里是fiddle
但是在网站 (http://c3denver.org/access/members/attendance) 上它不起作用,有什么想法吗?
单击其中一个带有某人姓名的框,例如 Scott,它会变成绿色,但是当我再次单击时,它应该变成红色并变回灰色,根据 jQuery(this).removeClass('transition ',400);.
它在小提琴中有效,但在网站上无效。
代码如下:
jQuery(document).ready(function(){
jQuery('.attendance .form .grid_padding label').click(function(evt){
evt.stopPropagation();
evt.preventDefault();
if(!jQuery(this).hasClass('attending')){
jQuery('input', this).prop('checked', true);
jQuery(this).addClass('attending');
}else{
jQuery(this).addClass('transition').removeClass('attending');
jQuery(this).removeClass('transition',400);
jQuery('input', this).prop('checked', false);
}
});
});
【问题讨论】:
标签: jquery jquery-ui jquery-animate removeclass