![]() |
| jQuery Logo |
Let's look at the way this script blog.
• Go to blogger.com with a password and id
• Open design or design Html → Edit → Expand Widget Centrang
• Find the code </ head> and place the following code above the code </ head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript'>
$(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>
• Find <body> code and change the code to <body id='top'>
• Place the following code above the code </ body> is usually located at the very bottom of the template
<div id='gotop'>
<a href='#top' title='Go to Top'>
<img src='http://i1042.photobucket.com/albums/b429/Farix_2010/FarixTop.png' style='right:20px;bottom:20px;position:fixed'/>
</a>
</div>
Change the green code as the image url as needed.
• Save the template and have completed tutorial about Back to TOP Gadgets with jQuery.
Source: farixsantips - Gadgets For Blogger

0 comments:
Post a Comment