Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.
This repository was 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

@stefan1959

Description

@stefan1959

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions