How to add back to top button

To add back to top button in your website add this in footer.php file of your theme

[php]<pre lang="php"><!–back to top–><script type="text/javascript">// <![CDATA[
$(document).ready(function(){

// hide #back-top first
$("#back-top").hide();

// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$(‘#back-top’).fadeIn();
} else {
$(‘#back-top’).fadeOut();
}
});
$(‘#back-top a’).bind("mouseover", function(){
var color = $(‘#back-top’).css("background-color");

$(‘#back-top’).css("background", "#999");

$(this).bind("mouseout", function(){
$(‘#back-top’).css("background", color);
})
})
// scroll body to 0px on click
$(‘#back-top a’).click(function () {
$(‘body,html’).animate({
scrollTop: 0
}, 800);
return false;
});
});

});
// ]]></script>
<div id="back-top" style="position: fixed; width: 40px;
bottom: 30px; right: 30px; float: right; display: block;
text-align: center; background: #CCC; padding: 3px 3px;">
<a href="#top"><span style="display: block;">
<img alt="" src="https://www.setubondhon.com/wp-content/uploads/2013/09/up-arrow2.png"
width="25" align="absmiddle" /></span>UP</a></div><p>
<!– end back to top–></p>
</pre>[/php]
You can show your own image also upload an image and change image link .https://www.setubondhon.com/wp-content/uploads/2013/09/up-arrow2.png

মন্তব্য

মন্তব্য সমুহ

সম্পর্কিত পোষ্ট =>  তারে কই বড় বাজিকর
মিতা- এর আরো পোষ্ট দেখুন →
রেটিং করুনঃ
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...