1

情况很简单:我正在为 Wordpress 使用 Bones 框架。如果我将 jQuery 放在 scripts.js 文件中,它们运行良好。一切正常。如果仅在是或否满足时尝试加载 jQuery 调用,则不会发生任何事情。我究竟做错了什么?

脚本.js

// Modernizr.load loading the right scripts only if you need them
Modernizr.load([
    {
    // Let's check something simple
    test : Modernizr.borderradius,
    // this should then satisfy the yep and load this script
    yep : ['libs/jq-desk-calls.js']
    }
]);

jQuery(document).ready(function($) {
    // if I put the code from jq-desk-calls.js here, it works fine
}

我正在使用一个简单的测试来确保它应该触发是的。但什么也没有发生。它调用的文件只是我可以在 document.ready 调用中使用的代码,并且工作正常。它是否与从外部文件调用 document.ready 有关?

jq-desk-calls.js

$(document).ready(function() {
   //LOGO ROLL
    $('li#menu-item-477').append('<div class="emblemhover"></div>');
}
4

0 回答 0