Skip to content

Commit

Permalink
Quick fix presenza elemento
Browse files Browse the repository at this point in the history
  • Loading branch information
francescozaia committed Jul 10, 2018
1 parent c4d8e75 commit 3f580cb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/js/plugins/back-to-top.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// ===== Scroll to Top ====
$(window).on('scroll', function () {
if ($(this).scrollTop() >= 50) {
if ($('a[data-attribute*="return-to-top"]').length && $(this).scrollTop() >= 50) {
$('a[data-attribute*="return-to-top"]').fadeIn(200);
} else {
$('a[data-attribute*="return-to-top"]').fadeOut(200);
Expand Down

0 comments on commit 3f580cb

Please sign in to comment.