Skip to content

Commit

Permalink
Yukarı çıkma düğmesi eklendi: #45
Browse files Browse the repository at this point in the history
  • Loading branch information
bugra9 committed Jun 12, 2016
1 parent d399172 commit 4f2a108
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
19 changes: 19 additions & 0 deletions _data/settings/backToTop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
active: true
dir: "extension/asset/backToTop"

hook:
index:
foot:
name: "asset"
posts:
foot:
name: "asset"
categories:
foot:
name: "asset"
tags:
foot:
name: "asset"
others:
foot:
name: "asset"
30 changes: 30 additions & 0 deletions extension/asset/backToTop/_asset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<script>
$( document ).ready(function() {
$( document ).scroll(function() {
if($(document).scrollTop() > 700 && $(document).scrollTop() < 1000)
$('.backToTop').removeClass('hidden');
else if($(document).scrollTop() < 700 && $(document).scrollTop() > 400)
$('.backToTop').addClass('hidden');
});

$('body').append('<div class="backToTop hidden"></div>');
$('.backToTop').on('click', function() {
$('body,html').animate({ scrollTop: 0 }, 700);
});
});
</script>
<style>
.backToTop {
position: fixed;
bottom: 20px;
right: 20px;
font-size: 38px;
padding: 10px 12px 12px;
background-color: #F2711C;
color: white;
cursor: pointer;
}
.backToTop:before {
content: "\f106";
}
</style>

0 comments on commit 4f2a108

Please sign in to comment.