Console.log not working at all

后端 未结 13 749
故里飘歌
故里飘歌 2020-12-29 02:13

A bunch of code isn\'t working and I\'m trying to identify where the problem lies but console.log() isn\'t logging any results in Chrome Dev tools, am I doing i

13条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 02:46

    I feel a bit stupid on this but let this be a lesson to everyone...Make sure you target the right selector!

    Basically the console wasn't logging anything because this particular code snippet was attempting to grab the scrolling area of my window, when in fact my code was setup differently to scroll an entire DIV instead. As soon as I changed:

    $(window).scroll(function() {
    

    to this:

    $('#scroller').scroll(function() {
    

    The console started logging the correct messages.

提交回复
热议问题