コンソールを見ると、以下のエラーが発生しています。
jQuery.easing[jQuery.easing.def] is not a function
WordPressでスライダーを作ろうとしています。私はローカルホストで作業しているので、何が起きているのか正確に表示できません。ただし、スライダーが WordPress 以外の HTML ファイルにある場合は機能します。WordPress では、そのエラーが表示されます。問題が何であるかについての洞察は大歓迎です。
コンソールを見ると、以下のエラーが発生しています。
jQuery.easing[jQuery.easing.def] is not a function
WordPressでスライダーを作ろうとしています。私はローカルホストで作業しているので、何が起きているのか正確に表示できません。ただし、スライダーが WordPress 以外の HTML ファイルにある場合は機能します。WordPress では、そのエラーが表示されます。問題が何であるかについての洞察は大歓迎です。
みんなの時間を節約するために。Jquery イージング プラグイン ファイルを開き、コードをラップします。
$(document).ready(function() {
Code goes here...
});
jQuery を複数回ロードしていないか確認してください。フッターを手動で挿入した場合は、削除してみてください。
問題は
swing: function (x, t, b, c, d) {
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
}
この関数の jQuery は、適用された jQuery と等しくありませんでしたjQuery.extend( jQuery.easing,
。
jQuery
と置き換えます$
コードをラップする
(function($, undefined) {
...
}) (jQuery);
did you import the jQuery easing plugin? something like
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
in your page?
if(typeof jQuery.easing[jQuery.easing.def] == 'function'){
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
}
easing.js の swing() 関数でこのコードを試してください
プラグインを使用する前に jquery.easing.1.3.js を head タグに配置するか、document.ready を使用します
jQuery イージング プラグインをインポートしていますか? または、1.7.2 よりも高いものはありますか?
次に、それを削除してこれを使用します:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>