开发者

jQuery,and other library right order to include?

开发者 https://www.devze.com 2022-12-25 11:48 出处:网络
I have a Wordpress theme that uses MooTools and jQuery. I use jQuery noConflict to avoid conflicts with 开发者_JS百科other JS libraries; this didn\'t help me.

I have a Wordpress theme that uses MooTools and jQuery. I use jQuery noConflict to avoid conflicts with 开发者_JS百科other JS libraries; this didn't help me.

Can someone help me with the right order of including JS libraries on my Wordpress theme?

Thanks in advance.


What you need to do is add this before your jquery code :

jQuery.noConflict();

and replace all JQuery $ by jQuery. For example :

  jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  });
  // Code that uses other library's $ can follow here.
0

精彩评论

暂无评论...
验证码 换一张
取 消