Href=“#” Don't Scroll

后端 未结 11 2289
暗喜
暗喜 2020-12-05 01:55

I am pretty new to JS - so just wondering whether you know how to solve this problem.

Current I have in my code



        
11条回答
  •  甜味超标
    2020-12-05 02:22

    return false is the answer, but I usually do this instead:

    $('.closeLink').click( function(event) {
          event.preventDefault();
          ...do the close action...
    });
    

    Stops the action from happening before you run your code.

提交回复
热议问题