Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

jquery conflict when I using jquery-2.1.1.min.js #411

Open
stefan1959 opened this issue Dec 31, 2019 · 0 comments
Open

jquery conflict when I using jquery-2.1.1.min.js #411

stefan1959 opened this issue Dec 31, 2019 · 0 comments

Comments

@stefan1959
Copy link

this may help someone, i presume this is just because of old code,
Original code I had before I added bootstrap and it was using jquery 1.6.1

<script type="text/javascript"> $(document).ready(function(){ $("#home-fade").nivoSlider({ // Image slider; requires 'nivoSlider' jQuery plugin effect: 'fade' ,directionNav: false ,controlNav: false ,animSpeed: 600 // Slide transition speed ,pauseTime: 4000 // How long each slide will show ,pauseOnHover: false // Stop animation while hovering }); }); </script>

Upgraded and using now jquery 2.1.1 but got a TypeError: $ is not a function error.
Alot of googling I found a workaround fix.

Fixed using

<script type="text/javascript"> var j = jQuery.noConflict(); j(document).ready(function(){ j("#home-fade").nivoSlider({ // Image slider; requires 'nivoSlider' jQuery plugin effect: 'fade' ,directionNav: false ,controlNav: false ,animSpeed: 600 // Slide transition speed ,pauseTime: 4000 // How long each slide will show ,pauseOnHover: false // Stop animation while hovering }); }); </script>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant