JavaScript How to stop scroll during the click event in Jquery

I have used more effects.The effects likes based on the drag the scroll in browser or going to down of the page in my home page.

I have implemented the top button, it can goes top of the page. When i click the top button. It's go to top, but very slow ie, step by step moves to top, because of the existing effects.

Top button coding:

jQuery('#to-top').click(function (e) {
    e.preventDefault();
    jQuery('html,body').animate({scrollTop: 0}, 800);
});

How to stop all other effects(scroll based effects) and allow the #top-top button scroll only?

Make sure once moved to top, the scroll based effects will work..

Answer:1

You have to add stop() to your function call

jQuery('#to-top').click(function (e) {
    e.preventDefault();
    jQuery('html,body').stop()animate({scrollTop: 0}, 800);
});

then to continue the scroll effect you will have to recall it, I'm not sure how do you habdle this

Answer:2

I am new to React and I try to build a timer component. Now I have the start function working but I would also like to stop the timer by an onclick handler. The problem is that the start function uses ...

I am new to React and I try to build a timer component. Now I have the start function working but I would also like to stop the timer by an onclick handler. The problem is that the start function uses ...

  1. stop interval in javascript
  2. stop interval in js
  3. stop interval in angularjs
  4. stop interval in jquery
  5. setinterval react native
  6. stop interval in angular
  7. setinterval on click
  8. stop interval in function
  9. typescript setinterval
  10. angular 6 stop interval
  11. stop interval in function javascript
  12. js stop interval from inside

I have an issue with tooltip in Highcharts column charts. When series fill my chart, the tooltip is under the serie. But he is cut by then end of div, as you can see here : What should I do to make ...

I have an issue with tooltip in Highcharts column charts. When series fill my chart, the tooltip is under the serie. But he is cut by then end of div, as you can see here : What should I do to make ...

  1. dynamic position tooltip javascript
  2. dynamic position tooltip jquery
  3. dynamic position tooltip
  4. css dynamic tooltip position

I need to take a JSON object and get the titles console logged for an auto complete feature. AN example of what my json looks like is below: [ { "title": "Example 1", "url": "http:\/\/www....

I need to take a JSON object and get the titles console logged for an auto complete feature. AN example of what my json looks like is below: [ { "title": "Example 1", "url": "http:\/\/www....

  1. json parsing error redshift
  2. json parsing error 8001
  3. json parsing error in row starting at position
  4. json parsing error no value for
  5. json parsing error android
  6. json parsing error
  7. json_parsing_error unexpected character (t) at position 0
  8. json_parsing_error unexpected character (-) at position 0
  9. json parsing error value
  10. json parsing error python
  11. json parsing error paladins
  12. json_parsing_error unexpected token end of file at position
  13. json parsing error unexpected token expected
  14. json_parsing_error unexpected token end of file
  15. json parsing error unexpected token
  16. json parsing error fcm
  17. json parse error unexpected eof
  18. json parse error cannot construct instance of
  19. json parse error cannot deserialize instance of
  20. json parse error unexpected identifier object

My code resembles this: router.post("/", (req, res, next) => { foo() .then((result) => { res.send(result) }) .catch((error) => { cosnole.log(error) }) //I only want the bar() ...

My code resembles this: router.post("/", (req, res, next) => { foo() .then((result) => { res.send(result) }) .catch((error) => { cosnole.log(error) }) //I only want the bar() ...