开发者

too many jquery docs in one page no conflict not working

开发者 https://www.devze.com 2023-02-20 16:51 出处:网络
I could be way off base here but I have this site http://ephemurl.com/4w/5tyand I think the reason the fancy jScrollpane plugin isn\'t working is due to an excessive amount of jQuery on that page, I h

I could be way off base here but I have this site http://ephemurl.com/4w/5ty and I think the reason the fancy jScrollpane plugin isn't working is due to an excessive amount of jQuery on that page, I h开发者_如何学JAVAope this makes sense. I just need help trying to get these all to work nicely together..

Any ideas? and they are all needed

http://code.jquery.com/jquery-latest.min.js

http://ephemurl.com/4w/5tz

http://ephemurl.com/4w/5u1

http://ephemurl.com/4w/5u2

http://ephemurl.com/4w/5u3

http://ephemurl.com/4w/5u4


.noConflict() tells your jQuery to let go of the $ variable for other libraries. Your about-tabs.js is using $ though, so that's definitely going to throw an error.

The easiest way to fix this is to change

$(document).ready(function(){

to

jQuery(function($){

This way, you can still use $ inside your ready function (so you don't have to change anything else.


In about-tabs.js, try changing $(document).ready(function () { to jQuery(document).ready(function ($) {. That line is causing an error at the moment because you have used no conflict.

Btw, no conflict isn't to prevent jQuery plugins conflicting with each other. It's to prevent jQuery conflicting with other frameworks.

0

精彩评论

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