Tombol Back To Top sangat berguna untuk kembali ke atas pada suatu laman blog secara cepat, sebab pengguna tidak perlu menscroll ke atas. Melainkan tinggal klik Back to top maka akan otomatis kembali ke atas.
Berikut langkah mudahnya.
1. Masuk ke laman Blok anda
2. Klik Tata Letak / Layout pada blogger
3. Klik Add Gadged / Tambahkan Gadget
4. Pilih HTML/JavaScript
5. Copaskan Code berikut ini
Berikut langkah mudahnya.
1. Masuk ke laman Blok anda
2. Klik Tata Letak / Layout pada blogger
3. Klik Add Gadged / Tambahkan Gadget
4. Pilih HTML/JavaScript
5. Copaskan Code berikut ini
Baca Juga
<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>
Ganti URL Gambar Back To Top dengan salah satu code di bawah ini;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFDX54rZ4Q0Y-GnPiZEE8z6tH7uDax_S6FWwjR8YXWI43gIlU1jkGLVl6QefsIe9Q3v_Fdtmy14BxOS0zyF0rnu28hNZ_y0Zfojy85jalB1dyb4Lpkkg-E5LQslsOZLz0tE_STazzY5xA/s1600/back+to+top.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiri3W2gJzT9Zj58LwxZKXqnzNmo_vKmJAwxu6IA-7Nx_ofEeTpOF2rVmv_qLrJRF02hl70j68X0e2r320dj83wVBvJzsxD5YcFmG4nygCUo8j420XpRtIaOYjkvA0odDuf-mSIRLcacO8/s1600/back+to+top.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq7MJWn4W5hpLP5wNA1JMEta-FUUwFVu5nvUby-BNaJuJZBzzZ4dRQOyQYGrpkWvq6AgLhe-h5rrrFbnmiZDHtMuQG-ncOTpUzV5e1Y2H6Xgu87QOjR7YY-4ROWfBL3UKNAwZAquqhqjU/s1600/back+to+top.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOFmAcdq5SiONDiGKCleC4OFJ2V1W74mBDDUd0-2e87NLa38PEbtafaBNIRChRvtb3ZYkPAYwsV36IkXp8A_T_Dsy72cMOeZVQiKc7rHQcix9-mBn2En1rNP7zS19zKLxKJprLgaOr2ck/s1600/back+to+top.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkEG-pAz3S3FOaVD2RadnNJ91okWFhaSFrOaUGIIsoS0fqvxIKTRbgCh205Vl35QUpub4GyoFxssntLX7A2KHoIa7R4tJ1uJ6MtCgjqw2yNsUDl0Ow-PygeIvn1f8Boq9kJdRuyJQH6VU/s1600/back+to+top+button.gif
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivf1urpo1KZ7bYiunj6Gprq74I9-usVtWxoi2IclzVU4kMxKqBto6Fy1wG3jKkubWmxcI8FBsmsh2_DOdvU06oOOMMKfEOMQZg6LyZFaqJvjzc1gGb6q2inlVTE9MP5Sn77o9tBve04Tc/s1600/back+to+top+button.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggHL_nH_zMTToUr5GRJXSHKj96IysA7ezFNGXM0dpg0FROz3fdGk0gnb7H-jg5_KUhgVwUcTEdH4uqVFWWsj5RI2k-oTvYDLijlwK1yJFsqmRDUG4-C_sAS19-mOSWU4ZP46qf_bOD5-4/s1600/back+to+top+button.gif
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheUSWzqOjub7dfawXwz0C6Sanz4RnzAVGLJgoxZgX40x8vdQemlI6kSq0sHRy-Roos8R_VfoGoEjF5ah5v-UmVwonHPIgJwGKfsyeA_CNTnxrfRhlxGkUx3kKFCgDV-1C0AmsdAVYpwQM/s1600/back+to+top+button.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgxp8vjI8Zg2h0R6xcrQLlOzPh1ZoCLE-Rk_LytM-icj9yDzE2MUTBp9jsLd3xwq97k7VFCbOH9BLiXomX1VSJBw0vsLFJC-I59pWlNify_lQCc_NwSDI6Cf1pJ86QSufw5RKEqLHMD4M/s1600/back+to+top.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiigzYrGSvhqeVEwKqJq321sF_Kn533jRXkQWnaxHLwHIoihTtjgmz1TRGRatOBzqWWR59Hjs4arpsQqE24A_ZITcMLk5pNf8xb8x8F1CRqX8ljnU_wPxaBoe0w4hVRIE5DhaksuRUQhdI/s1600/Back-To-Top.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzXlsslHpf9-cuvg8OtTTKY1WsqnuMSzy7bY3cIxLdYnD9XVteQt3vF5S5OeMq9tgS71EmjY5YhWriHM_KbvP_0xsZga2bVoYqY1e0-dFn2tgsKiAxNOmyVytwYiKPCilcux0A9Y9AcVQ/s1600/back-to-top-button.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPb3An9f6HWqDLRqb1XnMac67rp9eEgArDuc4xbDZreIUL0UIs5dqiwkjpmoLpTZrkO3O8vVjjzgGFGB1EwN6poCEBWgflJeIqP-0z5-iUlwhksRucg6SK_dVJ-e40eUmRstQ9z8rTlhA/s1600/back-to-top-button.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhf0ChhR1DnXqrOKaqk29Vi_BkISaXiuCx4S89kbGvzCczg2_4v3acedlqD-fHp_Kuq5WQf3h0ENrK9_NRcS2V_QJuEOP3Aoy2G7Xi0BG6XXpGXKoYlgXWAvWNeBpB8g7U-pOCQXq2pzZg/s1600/back-to-top-button.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfbxfTSr9gLDkDtr11zlY3Nefqfhruhj5vVS5XriKofo4cSiEw0Ed5ToA10hWxsObeZMEbTIpjKSKT7YRiVjo7UCk_O5R4cQOhgmspnouGylewT7Hl0gzzLEoEVXF8anBbPCbay_JVTZ4/s1600/Back-To-Top.png
Hasil;
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwbJ52ZxBVLjUQys8cV61qycXcSc5DyaXnnx0K6zm3X2KbIdm338tsRsyZnS2oz9y4p_eSiimOXy1B5UTsiW8O2vYBxICBhWvxv1knGBorUsBbel6Yi8NrxmpZF9k8XDUvrjwTW7BiNV8/s1600/back_to_top_button.png
Hasil;
Terima kasih telah berkunjung.
HALAMAN SELANJUTNYA:
ConversionConversion EmoticonEmoticon