- Cara membuatnya :
- Login blogger
- Rancangan, Edit Html, Cari kode ]]></b:skin>
- Dan Simpan kode berikut diatasnya :
/* -------------------------
Rocking Rolling Rounded Menu with jQuery and CSS3
----------------------------------------------- */
.item{
position:relative;
background-color:#f0f0f0;
float:right;
width:52px;
margin:0px 5px;
height:52px;
border:2px solid #ddd;
-moz-border-radius:30px;
-webkit-border-radius:30px;
border-radius:30px;
-moz-box-shadow:1px 1px 3px #555;
-webkit-box-shadow:1px 1px 3px #555;
box-shadow:1px 1px 3px #555;
cursor:pointer;
overflow:hidden;
}
.link{
left:2px;
top:2px;
position:absolute;
width:48px;
height:48px;
}
.icon_home{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBsC6IvlOPB91BHU5LtXlD1b4DVb5F4vYBaGnMG12QLLP4b_f286-1Rbls_Q3gioipg_TefcunBydYuStT14FE_hLgFVJRcRHt_Gw0xeUxwTDRSbAQiva6l8DtqP-jgbnbtSEyxJDu8DY/s1600/home.png) no-repeat top left;
}
.icon_mail{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnjQVOISM4TbaJNBi22vDfcLMRJZ70tSc5vCmNMh4u9iMH6Q1HO14vP0nC4kKqN2U956Nza141gVwU6OPr50NbeXhQCl0GqMU8DhwkbefyV8sqPy9-FWKGlS4sRjzg6LtzOdyChHDEYs4/s1600/mail.png) no-repeat top left;
}
.icon_help{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLqenvinOrjRG9Iud4ys64_PQ3NGSggGB16iKu1X5OGcKp8uuMjy8CkgVeMgN8bEGxRDx3v31EZcRcRIjL0qI3NS0tBaDbC2tENSvr_Fi-B4tjBlzfD2Gk2Yxxqc3yTcI1XjbTzHiTHRQ/s1600/help.png) no-repeat top left;
}
.icon_find{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilfKTjg23BUdLEEdhwHTsd2bvEm4bttCOhn0EehyphenhyphenDOUtX9syXeoTDVvKU-AVtwWTfNRzBx7DRbGlk2ZVmSTZBEA_qlPbkBwtuDfNXw2NCD2Uo0DU1IHu5kTqAy8E6EL0_m97kPt6sh7Ko/s1600/find.png) no-repeat top left;
}
.icon_photos{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbuAAknaRZ3LjkJrIDviagiBVsBcicFPbO-k6b2N9aSRYluQ_r5QySGyR38qAeo42Skv17gxJjK0AqTXWfoGxSUV8LNYlSiXFSwS781AJhXSNypCbOFDOxx_ND6bk1EcFGGeYZIhK7CQA/s1600/photos.png) no-repeat top left;
}
.item_content{
position:absolute;
height:52px;
width:220px;
overflow:hidden;
left:56px;
top:7px;
background:transparent;
display:none;
}
.item_content h2{
color:#aaa;
text-shadow: 1px 1px 1px #fff;
background-color:transparent;
font-size:14px;
}
.item_content a{
background-color:transparent;
float:left;
margin-right:7px;
margin-top:3px;
color:#bbb;
text-shadow: 1px 1px 1px #fff;
text-decoration:none;
font-size:12px;
}
.item_content a:hover{
color:#0b965b;
}
.item_content p {
background-color:transparent;
display:none;
}
.item_content p input{
border:1px solid #ccc;
padding:1px;
width:155px;
float:left;
margin-right:5px;
}
Rocking Rolling Rounded Menu with jQuery and CSS3
----------------------------------------------- */
.item{
position:relative;
background-color:#f0f0f0;
float:right;
width:52px;
margin:0px 5px;
height:52px;
border:2px solid #ddd;
-moz-border-radius:30px;
-webkit-border-radius:30px;
border-radius:30px;
-moz-box-shadow:1px 1px 3px #555;
-webkit-box-shadow:1px 1px 3px #555;
box-shadow:1px 1px 3px #555;
cursor:pointer;
overflow:hidden;
}
.link{
left:2px;
top:2px;
position:absolute;
width:48px;
height:48px;
}
.icon_home{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBsC6IvlOPB91BHU5LtXlD1b4DVb5F4vYBaGnMG12QLLP4b_f286-1Rbls_Q3gioipg_TefcunBydYuStT14FE_hLgFVJRcRHt_Gw0xeUxwTDRSbAQiva6l8DtqP-jgbnbtSEyxJDu8DY/s1600/home.png) no-repeat top left;
}
.icon_mail{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnjQVOISM4TbaJNBi22vDfcLMRJZ70tSc5vCmNMh4u9iMH6Q1HO14vP0nC4kKqN2U956Nza141gVwU6OPr50NbeXhQCl0GqMU8DhwkbefyV8sqPy9-FWKGlS4sRjzg6LtzOdyChHDEYs4/s1600/mail.png) no-repeat top left;
}
.icon_help{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLqenvinOrjRG9Iud4ys64_PQ3NGSggGB16iKu1X5OGcKp8uuMjy8CkgVeMgN8bEGxRDx3v31EZcRcRIjL0qI3NS0tBaDbC2tENSvr_Fi-B4tjBlzfD2Gk2Yxxqc3yTcI1XjbTzHiTHRQ/s1600/help.png) no-repeat top left;
}
.icon_find{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilfKTjg23BUdLEEdhwHTsd2bvEm4bttCOhn0EehyphenhyphenDOUtX9syXeoTDVvKU-AVtwWTfNRzBx7DRbGlk2ZVmSTZBEA_qlPbkBwtuDfNXw2NCD2Uo0DU1IHu5kTqAy8E6EL0_m97kPt6sh7Ko/s1600/find.png) no-repeat top left;
}
.icon_photos{
background:transparent url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbuAAknaRZ3LjkJrIDviagiBVsBcicFPbO-k6b2N9aSRYluQ_r5QySGyR38qAeo42Skv17gxJjK0AqTXWfoGxSUV8LNYlSiXFSwS781AJhXSNypCbOFDOxx_ND6bk1EcFGGeYZIhK7CQA/s1600/photos.png) no-repeat top left;
}
.item_content{
position:absolute;
height:52px;
width:220px;
overflow:hidden;
left:56px;
top:7px;
background:transparent;
display:none;
}
.item_content h2{
color:#aaa;
text-shadow: 1px 1px 1px #fff;
background-color:transparent;
font-size:14px;
}
.item_content a{
background-color:transparent;
float:left;
margin-right:7px;
margin-top:3px;
color:#bbb;
text-shadow: 1px 1px 1px #fff;
text-decoration:none;
font-size:12px;
}
.item_content a:hover{
color:#0b965b;
}
.item_content p {
background-color:transparent;
display:none;
}
.item_content p input{
border:1px solid #ccc;
padding:1px;
width:155px;
float:left;
margin-right:5px;
}
selanjutnya simpan script berikut tepat diatas kode </body> :
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="http://kangdadang.googlecode.com/files/jquery-css-transform.js" type="text/javascript"></script>
<script src="http://kangdadang.googlecode.com/files/jquery-animate-css-rotate-scale.js" type="text/javascript"></script>
<script>
$('.item').hover(
function(){
var $this = $(this);
expand($this);
},
function(){
var $this = $(this);
collapse($this);
}
);
function expand($elem){
var angle = 0;
var t = setInterval(function () {
if(angle == 1440){
clearInterval(t);
return;
}
angle += 40;
$('.link',$elem).stop().animate({rotate: '+=-40deg'}, 0);
},10);
$elem.stop().animate({width:'268px'}, 1000)
.find('.item_content').fadeIn(400,function(){
$(this).find('p').stop(true,true).fadeIn(600);
});
}
function collapse($elem){
var angle = 1440;
var t = setInterval(function () {
if(angle == 0){
clearInterval(t);
return;
}
angle -= 40;
$('.link',$elem).stop().animate({rotate: '+=40deg'}, 0);
},10);
$elem.stop().animate({width:'52px'}, 1000)
.find('.item_content').stop(true,true).fadeOut().find('p').stop(true,true).fadeOut();
}
</script>
<script src="http://kangdadang.googlecode.com/files/jquery-css-transform.js" type="text/javascript"></script>
<script src="http://kangdadang.googlecode.com/files/jquery-animate-css-rotate-scale.js" type="text/javascript"></script>
<script>
$('.item').hover(
function(){
var $this = $(this);
expand($this);
},
function(){
var $this = $(this);
collapse($this);
}
);
function expand($elem){
var angle = 0;
var t = setInterval(function () {
if(angle == 1440){
clearInterval(t);
return;
}
angle += 40;
$('.link',$elem).stop().animate({rotate: '+=-40deg'}, 0);
},10);
$elem.stop().animate({width:'268px'}, 1000)
.find('.item_content').fadeIn(400,function(){
$(this).find('p').stop(true,true).fadeIn(600);
});
}
function collapse($elem){
var angle = 1440;
var t = setInterval(function () {
if(angle == 0){
clearInterval(t);
return;
}
angle -= 40;
$('.link',$elem).stop().animate({rotate: '+=40deg'}, 0);
},10);
$elem.stop().animate({width:'52px'}, 1000)
.find('.item_content').stop(true,true).fadeOut().find('p').stop(true,true).fadeOut();
}
</script>
terakhir cara pemanggilannya pada HTML (tata letaknya sesuaikan dengan template dan keinginan):
<div class="item">
<a class="link icon_mail"></a>
<div class="item_content">
<h2>Contact us</h2>
<p>
<a href="#">eMail</a>
<a href="#">Twitter</a>
<a href="#">Facebook</a>
</p>
</div>
</div>
<div class="item">
<a class="link icon_help"></a>
<div class="item_content">
<h2>Help</h2>
<p>
<a href="#">FAQ</a>
<a href="#">Live Support</a>
<a href="#">Tickets</a>
</p>
</div>
</div>
<div class="item">
<a class="link icon_find"></a>
<div class="item_content">
<h2>Search</h2>
<p>
<input type="text"></input>
<a href="">Go</a>
</p>
</div>
</div>
<div class="item">
<a class="link icon_photos"></a>
<div class="item_content">
<h2>Image Gallery</h2>
<p>
<a href="#">Categories</a>
<a href="#">Archives</a>
<a href="#">Featured</a>
</p>
</div>
<a class="link icon_mail"></a>
<div class="item_content">
<h2>Contact us</h2>
<p>
<a href="#">eMail</a>
<a href="#">Twitter</a>
<a href="#">Facebook</a>
</p>
</div>
</div>
<div class="item">
<a class="link icon_help"></a>
<div class="item_content">
<h2>Help</h2>
<p>
<a href="#">FAQ</a>
<a href="#">Live Support</a>
<a href="#">Tickets</a>
</p>
</div>
</div>
<div class="item">
<a class="link icon_find"></a>
<div class="item_content">
<h2>Search</h2>
<p>
<input type="text"></input>
<a href="">Go</a>
</p>
</div>
</div>
<div class="item">
<a class="link icon_photos"></a>
<div class="item_content">
<h2>Image Gallery</h2>
<p>
<a href="#">Categories</a>
<a href="#">Archives</a>
<a href="#">Featured</a>
</p>
</div>
Sebagai tambahan java script yang diberi warna Biru, bisa diganti dengan alamat link Js berikut
http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
maksudnya penggantian itu jika kawan-kawan ingin efek putarannya
No comments:
Post a Comment