diff --git a/scroll_to_top.js b/scroll_to_top.js index 42ded55..f73bc5c 100644 --- a/scroll_to_top.js +++ b/scroll_to_top.js @@ -40,12 +40,14 @@ Drupal.behaviors.scroll_to_top = { }); // scroll body to 0px on click - $('#back-top a').click(function () { - $('body,html').animate({ - scrollTop: 0 - }, 800); - return false; - }); + $('#back-top a', context).once(function() { + $(this).click(function () { + $('body,html').animate({ + scrollTop: 0 + }, 800); + return false; + }); + }); }); } };