- Cara membuatnya :
- Login blogger
- Rancangan, Edit Html, Cari kode ]]></b:skin>
- Dan Simpan kode berikut diatasnya :
/* ---------------
jQuery Background Right left effect
---------------------------------- */
#Rightleft {
list-style:none;
margin:0;
padding:0;
}
#Rightleft li {
float:left;
width:100px;
margin:0;
padding:0;
text-align:center;
}
#Rightleft li a {
display:block;
padding:5px 10px;
height:100%;
color:#FFF;
text-decoration:none;
border-right:1px solid #FFF;
}
#Rightleft li a:hover, li a:focus, li a:active {
background-position:-150px 0;
}
#Rightleft a {
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHb2Vs8HHfYj2aPKU4-0x-9FadXJbGJuz4jznpcg4XsBve-qiiL7rfM77RKifHIUFNXB-oecitldfBN82fvM6YqxQ9YXsQwB_Ge6D2NHGa3Cd-Zpmt4_ffwaCNgUOrKBP43UKjcrCHH7o/s1600/bg2.jpg) repeat 0 0;
}
- Selanjutnya simpan script berikut diatas kode </head>:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://kangdadang.googlecode.com/files/jquery.bgpos.js"></script>
<script type="text/javascript">
$(function(){
$('#Rightleft a')
.css( {backgroundPosition: "0 0"} )
.mouseover(function(){
$(this).stop().animate({backgroundPosition:"(-150px 0)"}, {duration:500})
})
.mouseout(function(){
$(this).stop().animate({backgroundPosition:"(-300px 0)"}, {duration:200, complete:function(){
$(this).css({backgroundPosition: "0 0"})
}})
})
});
</script>
- Selanjutnya simpan script berikut diatas kode </head>:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://kangdadang.googlecode.com/files/jquery.bgpos.js"></script>
<script type="text/javascript">
$(function(){
$('#Rightleft a')
.css( {backgroundPosition: "0 0"} )
.mouseover(function(){
$(this).stop().animate({backgroundPosition:"(-150px 0)"}, {duration:500})
})
.mouseout(function(){
$(this).stop().animate({backgroundPosition:"(-300px 0)"}, {duration:200, complete:function(){
$(this).css({backgroundPosition: "0 0"})
}})
})
});
</script>
- Terakhir cara pemanggilannya pada Html atau pada template kalau saya biasa diletakkan di bawah tag <div id='head-nav'> (sesuaikan dengan template anda) :
<ul id="Rightleft">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Facebook</a></li>
<li><a href="#">Tutorial</a></li>
</ul>
- Selesai