Skip to content

自己在写javascript 遇到一个问题 大神给我找一下原因 #3

Description

@AngryBirdsFighting

声明: 页面引用了jquery. 要获取滚动的距离
1: function qq(){console.log($(window).scrollTop())}
$(window).scroll(qq());
2: $(window).scroll(function (){console.log($(window).scrollTop())};
1 里面获取的距离只显示一次 滚动完 刷新后才能更新,
2 里面的距离一直跟着滚动改变

why!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions