Go to Top

<style type="text/css">
.go-top {
position: fixed;
bottom: 2em;
left: 2em;
text-decoration: none;
color: white;
background-color: rgba(0, 0, 0, 0.3);
font-size: 12px;
padding: 1em;
display: none;
}

.go-top:hover {
background-color: rgba(0, 0, 0, 0.6);
}
</style>
<!-- gototop -->
<script type="text/javascript">
$(document).ready(function () {
$('[data-toggle="offcanvas"]').click(function () {
$('.row-offcanvas').toggleClass('active')
});
});
$(document).ready(function() {
// Show or hide the sticky footer button
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$('.go-top').fadeIn(200);
} else {
$('.go-top').fadeOut(200);
}
});

// Animate the scroll to top
$('.go-top').click(function(event) {
event.preventDefault();

$('html, body').animate({scrollTop: 0}, 2000);
})
});
</script>
<script type="text/javascript">
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
</script>
<a href="#" class="go-top hidden-xs">Go Top MOTHERFUCKER</a>

Tinggalkan Komentar

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

×