1

JSlint states this is $ was used before it was defined -->>

$(document).ready(function () {
    /*sticky nav*/
    $('.js--section-features').waypoint(function(direction) {
        if (direction == "down"){
            $('nav').addClass('sticky')

        } else {
            $('nav').removeClass('sticky')
        }

    })

smooth scrolling is not working either?? when i click the link to scroll to an element/section it takes me directly to it no smooth scrolling even after changing animation speed to 1000+. my scripts are correct so i don't know what to do

$('.js--scroll-to-discount-city').click(function () { $('html, body').animate({scrollTop: $('.js--section-discount-opt').offset().top}, 1500); });

  • Chances are there are conflicts between the JSlint and Jquery library files. To avoid such conflict, you can use keyword 'jquery' instead of $. Example : jquery('.js--section-features') – DinoMyte Feb 25 '16 at 01:12
  • 1
    can also tell it to ignore `$` in your jslint config file – charlietfl Feb 25 '16 at 01:17

0 Answers0