Negrionta Community
Energy Saving Mode Using CSS3

Move your mouse to go back to the page!
Gerakkan mouse anda dan silahkan nikmati kembali posting apa adanya

Copyright 2011 http://rizkymakkah.blogspot.com - All rights reserved
.

Selasa, 19 Juli 2011

Cara membuat menu collapsing site navigation dengan jQuery

 Cara membuat menu Collapsing Site Navigation dengan jQuery
adalah menu yang berisi bar navigasi vertikal dan slide out di area konten. melayang dan seperti jatuh , gambar slide turun dari atas ke bawah dan submenu slide dari bawah.jika sobat  Mengklik pada salah satu item submenu itu maka menu tersebut akan bergerak keseluruhan nya,menu akan nampak seperti setumpuk kartu...menu ini bisa di bilang keseluruhan nya mengunakan efek hover dan shadow.masih seperti biasa menu nya masih bewarnan hijo..~_~..kowkowkokw...tapi klw sobat gak suka warna hijo..sobat bisa ganti dengan warna yg laen ato sobat bisa juga menggunakan image untuk background nya...silahkan lihat demo dari Collapsing Site Navigation dengan jQuery seperti yang ada di blog ini:
UNTUK MEMBUATNYA IKUTI LANGKAH-LANGKAH DIBAWAH INI:

JANGAN LUPA BERIKAN KOMENTAR !!!




TERIMAKASIH !!!



  1. Login blogger
  2. Tata Letak/Layout - Edit HTML
  3. Klik pada Expand Template Widget.
  4.  Selanjutnya cari kode: ]]></b:skin>

Jika sudah ketemu letakkan kode CSS dibawah ini tepat sebelum atau diatas kode: ]]></b:skin> tersebut:
Copy Paste kode di bawah ini dan letakkan tepat di atasnya:


TERIMAKASIH...
.cc_menu{
    width:700px; /*140px * 5*/
    height:600px;
    position:relative;
    font-size:14px;
    text-transform:uppercase;
    color:#fff;
}
.cc_item{
    text-align:center;
    width:140px;
    height:600px;
    float:left;
    background:-moz-linear-gradient(top, #000, #000,#37c700);
    border-bottom:1px solid lime;
    position:relative;
        -moz-box-shadow: 1px -1px 3px lime;

}
span.cc_title{
    color:#fff;
    font-size:16px;
        text-shadow: 1px 1px 4px #000;
    top:200px;
    left:5px;
    position:absolute;
    padding:3px 0px;
    background:lime;
        border: 1px solid #fff;
        -moz-box-shadow: 1px 1px 20px lime;
    width:130px;
    display:block;
    z-index:11;

}
.cc_submenu ul{
    list-style:none;
    width:140px;
    margin:0;
    padding:0;
    height:0px; /*increase to 200px to slide up*/
    overflow:hidden;
    text-align:left;
    background:-moz-linear-gradient(top, lime, #002200,#001100);
        -moz-box-shadow: 1px 1px 10px lime;
    position:absolute;
    left:0px;
    bottom:0px;
    opacity:0.7;
    z-index:13;
}
.cc_submenu ul li{
font-family:Helvetica;
color:#fff;
font-size:12px;
        text-shadow: 1px 1px 4px #000;
    cursor:pointer;
    padding:10px;
}
.cc_item img{
    position:absolute;
    width:140px;
    height:600px;
    top:-600px;
    left:0px;
}
.cc_content{
    width:600px;
    height:600px;
    border-bottom:1px solid lime;
    position:absolute;
    left:-700px;
    background:-moz-linear-gradient(top, #000, #000,#37c700);
        -moz-box-shadow: 1px -1px 3px lime;
    overflow:hidden;


}
.cc_content div{
    display:none;
    margin:20px;
}
.cc_content p{
    background:lime;
        -moz-box-shadow: 1px 1px 20px lime;
    padding:20px;
    opacity:0.7;
}
span.cc_back{
    position:absolute;
    bottom:10px;
    right:10px;
    cursor:pointer;
        font-family:Georgia;
        color:#00ff00;
        font-size:20px;
        text-shadow: 0 0 4px lime, 0 -5px 4px #008800, 2px -10px 6px #006600,
        -2px  -15px 11px #004400, 2px -18px 18px #002200;
}
>









Dan Cari Kode: </head>
Letakkan Kode di bawah ini Tepat di atas kode: </head>



<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
Cufon.replace(&#39;span&#39;);
Cufon.replace(&#39;li&#39;);
Cufon.replace(&#39;h1&#39;);
Cufon.replace(&#39;p&#39;);
</script>
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push([&#39;_setAccount&#39;, &#39;UA-7243260-2&#39;]);
_gaq.push([&#39;_trackPageview&#39;]);
(function() {
var ga = document.createElement(&#39;script&#39;); ga.type = &#39;text/javascript&#39;; ga.async = true;
ga.src = (&#39;https:&#39; == document.location.protocol ? &#39;https://ssl&#39; : &#39;http://www&#39;) + &#39;.google-analytics.com/ga.js&#39;;
var s = document.getElementsByTagName(&#39;script&#39;)[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- The JavaScript -->
<script type='text/javascript'>
$(function() {
//all the menu items
var $items         = $(&#39;#cc_menu .cc_item&#39;);
//number of menu items
var cnt_items    = $items.length;
//if menu is expanded then folded is true
var folded        = false;
//timeout to trigger the mouseenter event on the menu items
var menu_time;
/**
bind the mouseenter, mouseleave to each item:
- shows / hides image and submenu
bind the click event to the list elements (submenu):
- hides all items except the clicked one,
and shows the content for that item
*/
$items.unbind(&#39;mouseenter&#39;)
.bind(&#39;mouseenter&#39;,m_enter)
.unbind(&#39;mouseleave&#39;)
.bind(&#39;mouseleave&#39;,m_leave)
.find(&#39;.cc_submenu &gt; ul &gt; li&#39;)
.bind(&#39;click&#39;,function(){
var $li_e = $(this);
//if the menu is already folded,
//just replace the content
if(folded){
hideContent();
showContent($li_e.attr(&#39;class&#39;));

else //fold and show the content
fold($li_e);
});
/**
mouseenter function for the items
the timeout is used to prevent this event
to trigger if the user moves the mouse with
a considerable speed through the menu items
*/
function m_enter(){
var $this     = $(this);
clearTimeout(menu_time);
menu_time     = setTimeout(function(){
//img
$this.find(&#39;img&#39;).stop().animate({&#39;top&#39;:&#39;0px&#39;},400);
//cc_submenu ul
$this.find(&#39;.cc_submenu &gt; ul&#39;).stop().animate({&#39;height&#39;:&#39;200px&#39;},400);
},200);
}
//mouseleave function for the items
function m_leave(){
var $this = $(this);
clearTimeout(menu_time);
//img
$this.find(&#39;img&#39;).stop().animate({&#39;top&#39;:&#39;-600px&#39;},400);
//cc_submenu ul
$this.find(&#39;.cc_submenu &gt; ul&#39;).stop().animate({&#39;height&#39;:&#39;0px&#39;},400);
}
//back to menu button - unfolds the menu
$(&#39;#cc_back&#39;).bind(&#39;click&#39;,unfold);
/**
hides all the menu items except the clicked one
after that, the content is shown
*/
function fold($li_e){
var $item= $li_e.closest(&#39;.cc_item&#39;);
var d = 100;
var step = 0;
$items.unbind(&#39;mouseenter mouseleave&#39;);
$items.not($item).each(function(){
var $item = $(this);
$item.stop().animate({
&#39;marginLeft&#39;:&#39;-140px&#39;
},d += 200,function(){
++step;
if(step == cnt_items-1){
folded = true;
showContent($li_e.attr(&#39;class&#39;));

});
});
}
/**
shows all the menu items
also hides any item&#39;s image / submenu
that might be displayed
*/
function unfold(){
$(&#39;#cc_content&#39;).stop().animate({&#39;left&#39;:&#39;-700px&#39;},600,function(){
var d = 100;
var step = 0;
$items.each(function(){
var $item = $(this);
$item.find(&#39;img&#39;)
.stop()
.animate({&#39;top&#39;:&#39;-600px&#39;},200)
.andSelf()
.find(&#39;.cc_submenu &gt; ul&#39;)
.stop()
.animate({&#39;height&#39;:&#39;0px&#39;},200);
$item.stop().animate({
&#39;marginLeft&#39;:&#39;0px&#39;
},d += 200,function(){
++step;
if(step == cnt_items-1){
folded = false;
$items.unbind(&#39;mouseenter&#39;)
.bind(&#39;mouseenter&#39;,m_enter)
.unbind(&#39;mouseleave&#39;)
.bind(&#39;mouseleave&#39;,m_leave);
hideContent();
}       
});
});
});
}
//function to show the content
function showContent(idx){
$(&#39;#cc_content&#39;).stop().animate({&#39;left&#39;:&#39;140px&#39;},200,function(){
$(this).find(&#39;.&#39;+idx).fadeIn();
});
}
//function to hide the content
function hideContent(){
$(&#39;#cc_content&#39;).find(&#39;div&#39;).hide();
}
});
</script>
>









Seandainya kode di atas gk bisa di atas kode </head>
coba di letak'an di atas kode:
</body>


Dan ini kode Html,sobat bisa memasukan di Edit HTML/ tambah gadget:

<div class="title">
</div>
<div class="cc_menu" id="cc_menu">
<div class="cc_item" style="z-index: 5;">
<img alt="image" src="http://i1125.photobucket.com/albums/l587/negrionta/adungkang.gif" />
<span class="cc_title">Home</span>
<div class="cc_submenu">
<ul>
<li class="cc_content_1">Winter 2010</li>
<li class="cc_content_2">Spring 2011</li>
</ul>
</div>
</div>
<div class="cc_item" style="z-index: 4;">

<img alt="image" src="http://i1125.photobucket.com/albums/l587/negrionta/NN1O.gif" />
<span class="cc_title">Stores</span>
<div class="cc_submenu">
<ul>
<li class="cc_content_3">Milano</li>
<li class="cc_content_4">Paris</li>
<li class="cc_content_5">New York</li>
<li class="cc_content_6">Miami</li>
</ul>
</div>
</div>
<div class="cc_item" style="z-index: 3;">
<img alt="image" src="http://i1125.photobucket.com/albums/l587/negrionta/hunter_running_from_bear_lg_clr.gif" />
<span class="cc_title">About</span>
<div class="cc_submenu">
<ul>
<li class="cc_content_7">About us</li>
<li class="cc_content_8">Our Philosophy</li>
</ul>
</div>
</div>
<div class="cc_item" style="z-index: 2;">
<img alt="image" src="http://i1125.photobucket.com/albums/l587/negrionta/104.gif" />

<span class="cc_title">Events</span>
<div class="cc_submenu">
<ul>
<li class="cc_content_9">Bacardi Summer Party</li>
<li class="cc_content_10">Lonestyle Auction</li>
</ul>
</div>

</div>
<div class="cc_item" style="z-index: 1;">
<img alt="image" src="http://i1125.photobucket.com/albums/l587/negrionta/257.gif" />
<span class="cc_title">Contact</span>
<div class="cc_submenu">
<ul>
<li class="cc_content_11">Custom Orders</li>
<li class="cc_content_12">Get in touch</li>
</ul>
</div>
</div>
<div class="cc_content" id="cc_content">
<span class="cc_back" id="cc_back">&lt;&lt; Go back</span>
<div class="cc_content_1">
<h1>
Winter 2010</h1>

Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.</div>
<div class="cc_content_2">
<h1>
Spring 2011</h1>
It is a paradisematic country, in which roasted parts of sentences fly into your mouth. Even the all-powerful Pointing has no control about the blind texts it is an almost unorthographic life One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.</div>
<div class="cc_content_3">

<h1>
Milano</h1>
She packed her seven versalia, put her initial into the belt and made herself on the way. When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek</div>
<div class="cc_content_4">
<h1>
Paris</h1>
One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. </div>

<div class="cc_content_5">
<h1>
New York</h1>
It wasn't a dream. His room, a proper human room although a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame.</div>
<div class="cc_content_6">
<h1>
Miami</h1>
It wasn't a dream. His room, a proper human room although a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame.

</div>
<div class="cc_content_7">
<h1>
About us</h1>
It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather.</div>
<div class="cc_content_8">
<h1>
Our Philosophy</h1>

A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine. I am so happy, my dear friend, so absorbed in the exquisite sense of mere tranquil existence, that I neglect my talents.</div>
<div class="cc_content_9">
<h1>
Bacardi Summer Party</h1>
I should be incapable of drawing a single stroke at the present moment; and yet I feel that I never was a greater artist than now. When, while the lovely valley teems with vapour around me, and the meridian sun strikes the upper surface of the impenetrable foliage of my trees, and but a few stray gleams steal into the inner sanctuary, I throw myself down among the tall grass by the trickling stream; and, as I lie close to the earth</div>
<div class="cc_content_10">

<h1>
Lonestyle Auction</h1>
To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire</div>
<div class="cc_content_11">
<h1>
Custom Orders</h1>
Winter collection</div>

<div class="cc_content_12">
<h1>
Get in touch</h1>
Winter collection</div>
</div>
</div>
<div>
<span class="reference">
</span></div>


Semoga bermanfaat...
post by: putramakkah

0 komentar:

Tempel Komentar

Putra Makkah © 2011 Template by:
Negrionta Community