简体   繁体   English

匿名函数错误

[英]anonymous function error

Can someone tell me what's wrong with the following? 有人可以告诉我以下内容有什么问题吗?

$(document).ready(function() {
    $('.nav_menu .dropdown').css('display', 'block');
    $('ul.nav').toggleclass('dropmenu');
    $('.nav_menu > ul').dropmenu({
        effect: 'slide',
        speed: 250,
        timeout: 0,
        nbsp: false
    });
});​

Safari reports that the toggleclass is an anonymoous function, whatever that means! Safari报告该toggleclass是一个匿名函数,这意味着什么!

thanks 谢谢

I think you are missing the camel case on toggleClass 我认为您缺少关于toggleClass的骆驼案

//                v--- case C instead of c
$('ul.nav').toggleClass('dropmenu');

It's a typo: c --> C 这是一个错字:c-> C
it should be: 它应该是:

.toggleClass()
       ^-------------camelCase, big C

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM