Use Sprites to Create an Awesomeness-Filled Navigation Menu

DEMO : http://jqzoom-l.blogspot.com/

langsung saja tanpa improvisasi , masuk blogger -rancangan - Edit HTML

step 1 : copas kode berikut di atas ]]></b:skin> atau rombak sedikit di css body anda

@charset "utf-8";
/* CSS Document */
@import url('reset.css');

body{
background:#000000; }

#nav
{
background: url(http://d2o0t5hpnwv4c1.cloudfront.net/512_dragon/demo/images/slice.jpg) repeat-x;
width:100%;
height:70px;
}
#navigation
{
margin-left:250px;
}



#navigation li
{

float:left;
display:block;
}

#navigation li a
{
background-image:url(http://d2o0t5hpnwv4c1.cloudfront.net/512_dragon/demo/images/sprite.jpg);
display: block;
    outline: none;
    position: relative;
    height: 70px;
    text-decoration: none;
    width: auto;

}



   
    #navigation .home
    {
    background-position:0px 0px;
    width:102px;
    height:70px;
   
    }
   
    #navigation .services
    {
    background-position:-102px 0px;
    width:110px;
    height:70px;
    }
   
    #navigation .portfolio
    {
    background-position:-212px 0px;
    width:108px;
    height:70px;
    }
   
    #navigation .about
    {
    background-position:-320px 0px;
    width:102px;
    height:70px;
    }
   
    #navigation .contact
    {
    background-position:-422px 0px;
    width:103px;
    height:70px;
    }
   
   
   
    #navigation a .hover {
    background: transparent  url(http://d2o0t5hpnwv4c1.cloudfront.net/512_dragon/demo/images/sprite.jpg) no-repeat;
    display:block ;
    opacity: 0;
    position: relative;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
   
    }
   
    #navigation .home .hover {
    background-position: -0px -72px;
   
    }
    #navigation .services .hover{
    background-position: -102px -72px;
   
    }
    #navigation .portfolio .hover {
    background-position: -212px -72px;
    }
    #navigation .about .hover {
    background-position: -320px -72px;
    }
    #navigation .contact .hover {
    background-position: -422px -72px;
    }
   
step 2 : js nya silakan copy kode berikut di atas </head>

<script type="text/javascript" src="http://longfield21.googlecode.com/files/jquery.js"></script>

<script type="text/javascript" src="http://longfield21.googlecode.com/files/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="http://longfield21.googlecode.com/files/sprite.js"></script>
 
 
step 3 : sekrang di bawah <body> rombak div menu anda atau silakan tambah 
<div id="nav">
<ul id="navigation">
 <li><a class="home" href="#"></a></li>
 <li><a class="services" href="#"></a></li>
 <li><a class="portfolio" href="#"></a></li>
 <li><a class="about" href="#"></a></li>
    <li><a class="contact" href="#"></a></li>
</ul>
</div>
 
 
step 4 : untuk gambar anda bisa merubah dengan mengedit lewat phootoshop namun ukuran gambar harus tepat.
Selamt mencoba!!!

0 komentar:

Post a Comment