- Cara membuatnya :
- Login blogger
- Rancangan, Edit Html, Cari kode ]]></b:skin>
- Dan Simpan kode berikut diatasnya :
/*Animated Hover with jQuery*/
#anihover {
margin: 100px 0 0;
padding: 0;
list-style: none;
}
#anihover li {
padding: 0;
margin: 0 2px;
float: left;
position: relative;
text-align: center;
}
#anihover a {
padding: 14px 10px;
display: block;
color: #000000;
width: 144px;
text-decoration: none;
font-weight: bold;
background: url(images/button.gif) no-repeat center center;
}
#anihover li em {
font-weight: normal;
background: url(images/hover.png) no-repeat;
width: 180px;
height: 45px;
position: absolute;
top: -85px;
left: -15px;
text-align: center;
padding: 20px 12px 10px;
font-style: normal;
z-index: 2;
display: none;
}
4. Selanjutnya simpan kode 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">
$(document).ready(function(){
$("#anihover a").append("<em></em>");
$("#anihover a").hover(function() {
$(this).find("em").animate({opacity: "show", top: "-75"}, "slow");
var hoverText = $(this).attr("title");
$(this).find("em").text(hoverText);
}, function() {
$(this).find("em").animate({opacity: "hide", top: "-85"}, "fast");
});
});
</script>
5. Save Template
6. Cara pemanggilannya pada Html :
<ul id="anihover">6. Selesai
<li>
<a href="#" title="Go to homepage">Home</a>
</li>
<li>
<a href="#" title="Find out who I am">About</a>
</li>
<li>
<a href="#" title="Subscribe RSS feeds">Subscribe RSS</a>
</li>
</ul>
Selamat mencoba. :)
0 komentar:
Posting Komentar