<div style="height:2000px;">
<p id='back-ltop' class='hide_element'>
<a href='#top'><span></span</a>
</p>
<style>
/*******Go to top ******/
#back-ltop {
position: fixed;
z-index: 999;
right: 35px;
bottom: 165px;
}
/* arrow icon (span tag) */
#back-ltop span {
width: 40px;
height: 40px;
display: block;
margin-bottom: 7px;
background: #ddd url(/images/bs_revamp/download-icon.png) no-repeat center center;
/* rounded corners */
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
/* transition */
-webkit-transition: 1s;
-moz-transition: 1s;
transition: 1s;
}
</style>
<script>
$(document).ready(function(){
// hide #back-top first
$("#back-ltop").hide();
// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#back-ltop').fadeIn();
} else {
$('#back-ltop').fadeOut();
}
});
// scroll body to 0px on click
$('#back-ltop a').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
});
</script>
</div>
<p id='back-ltop' class='hide_element'>
<a href='#top'><span></span</a>
</p>
<style>
/*******Go to top ******/
#back-ltop {
position: fixed;
z-index: 999;
right: 35px;
bottom: 165px;
}
/* arrow icon (span tag) */
#back-ltop span {
width: 40px;
height: 40px;
display: block;
margin-bottom: 7px;
background: #ddd url(/images/bs_revamp/download-icon.png) no-repeat center center;
/* rounded corners */
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
/* transition */
-webkit-transition: 1s;
-moz-transition: 1s;
transition: 1s;
}
</style>
<script>
$(document).ready(function(){
// hide #back-top first
$("#back-ltop").hide();
// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#back-ltop').fadeIn();
} else {
$('#back-ltop').fadeOut();
}
});
// scroll body to 0px on click
$('#back-ltop a').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
});
</script>
</div>