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/AVvXsEhRrvFveVAurrus9kyEX05a22H3wBr5zx64PPla5kqYk_ywEvlZBtiywuvwwP5bcV2-fnpLoP6z6zLhLjgKwj8w8O9zIdm1y0GtYkXTdgG6AYJK3boY_iz_-0P2__BGw8yik1SEh3NzUpIp/s1600/back+to+top15.png

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnZ4J8zb_YEPQ7sqWQQBqqUoXypnVEdPkhHjz6SVfdmzX5NiqsjN4cldtFagDUJVtMv4-a662VmTYtRWssI2k4-uzXIn9X6TF7u3l5VLAKt9w79XbRLvddI6Gi8diY2RUqmPzjQCKEEZY/s1600/5.png

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhhsux-1_uDFB4m8_GYVt39-03_vc4Y01-BRU6Hnph1aeB-PJRnd1oYV-S4YHVX1QELW9VOhy3ZdJ3PMiAQH3CUUfeM0wyxPhEe36JVns0oPuUkplY4rSqUMMoqfHHzVOTVwPSB0ylVDQt/s1600/back+to+top14.png

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWxP9JSbY7ipmrochERPVijdbhwYOmXGdyD9C4BJYP5HtsdY9x1gKJG4Aro13C4gjgydpWePYpVhp-hGFT3kiBeLl9vpew2xVEM2AKizoHEpaniMDwMNm_62dfGs6isjgzbVE8WIaHFOQ/s1600/2.png
Gambar Tombol Back To Top Dengan Gaya Animasi

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH9U3rdGLrN4C0eibHqjBI5H0LMTIsh-RWvqjAa0L399PbBN9t5_ay6X75QpmaIWEYqr8sHeyodFaAzSJ92HHjknA__GGFJkEQ33cmS2uZ0nnJACyabbW_SemO_GWoorESIn2tDMW0EiZ5/s1600/back+to+top4.gif

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5sTqgBvzqlFFjAIsXQczDqSyyR7tscZjUnSmO1bXqTArd-POBHEJ3RCg3UH1jXtwLHJC1GjPMe0C_ZHZkwIPUeCrGm__90dy-Izze8EbcKFZZb3kKhyYVbFJbWN4hzvBbkGjzEzR6Demm/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.
.jpg)
Posting Komentar