Memasang Back To Top Smooth Scroll akan memberikan effect lebih lancar untuk kembali ke atas.
1. Sign in akaun blogger.
2. Pilih LAYOUT --> EDIT HTML.
3. Cari kod ini.
</head>
4. Copy kod di bawah dan Paste di atas kod tadi.
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js' type='text/javascript'/> <script type='text/javascript'>
//<![CDATA[
$(function(){
$('a[href*=#top]').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) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});
});
//]]>
</script>
<!-- end scrolltop -->
//<![CDATA[
$(function(){
$('a[href*=#top]').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) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});
});
//]]>
</script>
<!-- end scrolltop -->
5. Cari kod ini.
<body>
6. Gantikan kod di atas dengan kod ini.
<body id='top'>
7. Seterusnya, cari kod ini.
</body>
8. Copy kod di bawah dan tambahkan di atas kod tadi.
<div id='goingtop'>
<a href='#top' title='Top'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicOI2Y28DYHngJBVSQrMOw7eeiaThny9v7MVP6nAo-yaB6vylSzCDh4_9Zy2qoRWDc7X0nUywpOPMAcv03uL8v1Gaan7mMMg0A5eRiCl88hoEBi7wybes95tJLY2F4qj2oqrQYsWnYCbuq/' style='right:20px; bottom:20px; position: fixed;'/></a></div>
<a href='#top' title='Top'><img src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicOI2Y28DYHngJBVSQrMOw7eeiaThny9v7MVP6nAo-yaB6vylSzCDh4_9Zy2qoRWDc7X0nUywpOPMAcv03uL8v1Gaan7mMMg0A5eRiCl88hoEBi7wybes95tJLY2F4qj2oqrQYsWnYCbuq/' style='right:20px; bottom:20px; position: fixed;'/></a></div>
9. SAVE TEMPLATE.
Gantikan Url berwarna merah sekiranya anda mahu menukarkan Image button.
2 comments:
best aaa..menjadik!!! thanks bro
saya try pun alhamdulillah jadik
sila la jengah ziarah saya pulak ye tqvm.. :)
Post a Comment