This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Jquery conflict

#9726
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Well, I don’t know it it’s related, but I see 2 instances of jQuery loaded within the same scope. One is after this line in the header:

[html]<!– Some inline Javascript for fast loadings –>[/html]

The other is the built-in jQuery. I believe the first one should not be there at all.
Then if I try to access:

[html]$.fn.velocity[/html]

in the console, it returns undefined – which suggests that the script is not loaded, but

[html]jQuery.fn.velocity[/html]

returns a function. Meaning that the $ scope is a different jQuery or the velocity script is not loaded there.

—–

1. I would recommend removing the first instance of the jQuery, it’s unneccessary, and it’s overwritten by the built-in jquery anyways.
2. Try changing the ready statement you use in the header from:
[html]
$(document).ready(function(){[/html]

to

[html]jQuery(document).ready(function($){[/html]

It’s much better, as it will always use the original jQuery, and pass it on as the $ into the function, so you can still use it in your code.