【问题标题】:JQuery UI removeClass Animation Not Working on Site But Working in JSFiddleJQuery UI removeClass 动画不在现场工作,但在 JSFiddle 工作
【发布时间】: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


    【解决方案1】:

    你不包括 jquery-ui.js 和样式表请包括这些

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.csss">
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    

    【讨论】:

    • jQuery ui 正在加载。我还添加了样式表,但它仍然无法在网站上运行。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-27
    • 2011-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-31
    • 1970-01-01
    相关资源
    最近更新 更多