Saat Kita Baca Postingan Yang Panjang Banget Sampe Ke Bawah,
Terus Pengen Baca Lagi Dari Atas Tapi Scroll Mouse Rusak. Apa Pernah Loe
Ngalamin Hal Tersebut Gan? Kalo Pernah Pasti Repot Karena Harus Narikin Tombol
Scroll Di Browser Ya Gak. Apalagi Kalo Pake Laptop Cuma Pake Touch Pad
Waduh Bikin Sebel.
Nah Kita Sebagai Pemilik Blog Harus Cari Cara Buat Mengatasi Masalah Itu, Biar Pengunjung Blog Betah Baca Postingan Kita Gan. Caranya Ya Kita Pasang TombolBack To Top, Jadi Pengunjung Tinggal Ngeklik Tombol Aja Kalau Pengen Balik Ke Atas Gan.
Nah Kita Sebagai Pemilik Blog Harus Cari Cara Buat Mengatasi Masalah Itu, Biar Pengunjung Blog Betah Baca Postingan Kita Gan. Caranya Ya Kita Pasang TombolBack To Top, Jadi Pengunjung Tinggal Ngeklik Tombol Aja Kalau Pengen Balik Ke Atas Gan.
- Pertama masuk ke Blogger lalu pilih Tata Letak terus Add a Gadget Lalu Pilih HTML/JavaScript . Lalu Paste Kode Berikut Di Dalamnya .
<script
type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" >
var scrolltotop={
//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
controlHTML: '<img src="URL Gambar Back To Top" />', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
controlattrs: {offsetx:5, offsety:5}, //offset of control relative to right/ bottom of window corner
anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
state: {isvisible:false, shouldvisible:false},
scrollup:function(){
if (!this.cssfixedsupport) //if control is positioned using JavaScript
this.$control.css({opacity:0}) //hide control immediately after clicking it
var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists
dest=jQuery('#'+dest).offset().top
else
dest=0
this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
},
keepfixed:function(){
var $window=jQuery(window)
var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
this.$control.css({left:controlx+'px', top:controly+'px'})
},
togglecontrol:function(){
var scrolltop=jQuery(window).scrollTop()
if (!this.cssfixedsupport)
this.keepfixed()
this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
if (this.state.shouldvisible && !this.state.isvisible){
this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])
this.state.isvisible=true
}
else if (this.state.shouldvisible==false && this.state.isvisible){
this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1])
this.state.isvisible=false
}
},
init:function(){
jQuery(document).ready(function($){
var mainobj=scrolltotop
var iebrws=document.all
mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>')
.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'})
.attr({title:'Scroll Back to Top'})
.click(function(){mainobj.scrollup(); return false})
.appendTo('body')
if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
mainobj.togglecontrol()
$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
mainobj.scrollup()
return false
})
$(window).bind('scroll resize', function(e){
mainobj.togglecontrol()
})
})
}
}
scrolltotop.init()
</script>
<script type="text/javascript" >
var scrolltotop={
//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
controlHTML: '<img src="URL Gambar Back To Top" />', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
controlattrs: {offsetx:5, offsety:5}, //offset of control relative to right/ bottom of window corner
anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
state: {isvisible:false, shouldvisible:false},
scrollup:function(){
if (!this.cssfixedsupport) //if control is positioned using JavaScript
this.$control.css({opacity:0}) //hide control immediately after clicking it
var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists
dest=jQuery('#'+dest).offset().top
else
dest=0
this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
},
keepfixed:function(){
var $window=jQuery(window)
var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
this.$control.css({left:controlx+'px', top:controly+'px'})
},
togglecontrol:function(){
var scrolltop=jQuery(window).scrollTop()
if (!this.cssfixedsupport)
this.keepfixed()
this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
if (this.state.shouldvisible && !this.state.isvisible){
this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])
this.state.isvisible=true
}
else if (this.state.shouldvisible==false && this.state.isvisible){
this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1])
this.state.isvisible=false
}
},
init:function(){
jQuery(document).ready(function($){
var mainobj=scrolltotop
var iebrws=document.all
mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>')
.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'})
.attr({title:'Scroll Back to Top'})
.click(function(){mainobj.scrollup(); return false})
.appendTo('body')
if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
mainobj.togglecontrol()
$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
mainobj.scrollup()
return false
})
$(window).bind('scroll resize', function(e){
mainobj.togglecontrol()
})
})
}
}
scrolltotop.init()
</script>
Sekarang Gantu Tulisan Yang Bewarna Merah Dengan URL Gambar Punya
Agan Lalu Simpan .
Jika Agan Tidak Memiliki Gambar Tombol Back To Top Bisa Menggunakan Gambar Di Bawah Sini Kok :
Gambar Tombol Back To Top Standar
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRtwnVs5SI_WBarIqRGzweQkbMbv2e6mRe2zmbD4Sx3wmORra4aDmAemNDi9VvYbwang6hpQvuZgpAqdtixaYvwS93rXFRntsJRkj7ETznYp9LbUA8PL8fD4EdQDTttWv1bmvk_MqfK-v9/s1600/back+to+top15.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5xmJCf7EcaJRhchyXEetC2OkbwzBuX79KXlB70Z8rsyQabuAIcGQFlvg7_cqufKuwj1mAtlEP-m8bxDd6xdLWAyWU8LdxoZbxbhGuqswOKv6nTQPMgvgDiEWMvjByo2vyGLjC3PQmrsc/s1600/5.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvLMY13BVTJJdaoQF7DXmP64fS8Zli67oD_5BNKkp7-Imtu6pxMMDcM-fdvAN1ItHl1zTMJVhDiU_HuhHw1DpJdsaeWAnOtVeqgyhzFhzDLUkxY8TD8fEKeLDRoTETDhdupbBlKtieE6hz/s1600/back+to+top14.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLPs-NIRjLiohjH_c4CqLUxhSq_HLZwkvffehJGW62vUaJR7wsiTsuZw4L0JsvD2qN0U7ZdhtRtT3EeQUnPAHIAJVDTNUI3RULJZsrx00tXEW0JQa4M6NQPQnFqOP_DvqU0E-OICEcHBs/s1600/2.png
Gambar Tombol Back To Top Dengan Gaya Animasi
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi751HwXL__yATt-_nI98RYANJ4uybJCNSTpkoUXfAT7dNfn3GzDTojQl8JNdYBq4x9o4I6xJfl595iPO_M7B09MEwd0NZ5ipJtxfOvbFo8j3jaqHxlNHvapy5JVBEkZNXD3Xgd-ubFfKmz/s1600/back+to+top4.gif
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB0m9lcFYY1xTWmuPU6KrRZZXTUsHkkhvZMo47__A0ZZNKYfSLpHt2BTac4fMcSt6dKv2jc5RbrdSwy96QXztugDHomgkmkNghQN3AUO-RECSq4BDJFGNGLemWNztMcH-hLB__FPJ6XKs-/s1600/back+to+top9.gif
gISRgZA4hnY/UPblPTIT1pI/AAAAAAAACAU/w9eLeowmJZE/s1600/back+to+top10.gif
Catatan : Kalo Agan Mau Rubah Kecepatan Scrollnya Bisa Di Edit Aja Scrollduration, Semakin Besar Angkanya Semakin Lambat Gerakan Ke Atasnya Gan.
Gampang Bukan ? Cara Membuat Tombol Back To Top Di Blog nya
! Sekian Dulu Dari Saya Tentang Cara Membuat Tombol Back To Top, Semoga
Bermanfaat Buat Kalian Semua. Jangan Lupa Ninggalin Komentar Ya Gan.
.
BalasHapuslangsung praktek mas, masalahnya blog saya belum pakai, mau langsung coba dah,,hehe
BalasHapussukses selalu dan happy blogging
Silahkan Mbak :)
Hapussangat bermanfaat tips nya sobatku :) mudah untuk dipraktekan dan jelas sekali :)
BalasHapusIya Siip Gan ... :)
HapusUsaha yg sangat bagus dikongsikan kepada semua. Good job!
BalasHapusSama Sama Uda :)
BalasHapusnice bater!
BalasHapus