Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Back to top button added #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Back to top button added
1880akshay committed Dec 14, 2019
commit d956c58ff38dda41e42a8b343934682e0190acc0
30 changes: 30 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -11834,4 +11834,34 @@ background-image: linear-gradient(315deg, #485461 0%, #28313b 74%);
margin-top: -100% !important;
margin-bottom: -20%;
}
}

/*Styling for back to top button*/

#back2top {
width: 40px;
line-height: 40px;
overflow: hidden;
z-index: 999;
display: none;
cursor: pointer;
-moz-transform: rotate(270deg);
-webkit-transform: rotate(270deg);
-o-transform: rotate(270deg);
-ms-transform: rotate(270deg);
transform: rotate(270deg);
position: fixed;
bottom: 55px;
right: 0;
background-color: #4d647b;
color: #FFF;
text-align: center;
font-size: 30px;
text-decoration: none;
border-radius: 8px 8px 0px 0px;
}

#back2top:hover {
background-color: #DDF;
color: #000;
}
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -557,6 +557,12 @@ <h3 class="heading"><a href="#">Even the all-powerful Pointing has no control ab
</div>
</section> -->

<!--Adddition of dynamic back to top button-->

<a id="back2top" title="Back To Top" href="#">&#10148;</a>



<footer class="ftco-footer ftco-bg-dark ftco-section">
<div class="container">
<!-- <div class="row mb-5">
18 changes: 18 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -295,3 +295,21 @@

})(jQuery);

//Working of back to top button

$(window).scroll(function() {
var height = $(window).scrollTop();
if (height > 100) {
$('#back2top').fadeIn();
} else {
$('#back2top').fadeOut();
}
});
$(document).ready(function() {
$("#back2top").click(function(event) {
event.preventDefault();
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});

});