Saturday 28 July 2012

Accrodian Navbar

Assalammualaikum
Smiley ^_^


Dah lama tak buat tutorials. Accordian Navbar tu menu tab. Bila kita touch dia pakai cursor ,
automatik dia akan jatuh. Bukan jatuh terhempap tu !

BEFORE


AFTER


1) Dashboard > Design > Edit HTML > F3 search this code.
]]></b:skin>
2) Copy and paste atas code ]]></b:skin> .

ul.tabs {
margin: 0;
padding: 0;
float: left;
list-style: none;
height: 300px; /*--Set height of tabs--*/
border-bottom: 1px solid #999;
border-left: 1px solid #999;
width: 100%;
}
ul.tabs li {
float: left;
margin: 0;
padding: 0;
height: 150px; /*--Subtract 1px from the height of the unordered list--*/
line-height: 300px; /*--Vertically aligns the text within the tab--*/
border: 1px solid #999;
border-left: none;
margin-bottom: -1px; /*--Pull the list item down 1px--*/
overflow: hidden;
position: relative;
background: #e0e0e0;
}
ul.tabs li a {
text-decoration: none;
color: #000;
display: block;
font-size: 1.2em;
padding: 0 20px;
border: 1px solid #fff; /*--Gives the bevel look with a 1px white border inside the list item--*/
outline: none;
}
ul.tabs li a:hover {
background: #ccc;
}
html ul.tabs li.active, html ul.tabs li.active a:hover { /*--Makes sure that the active tab does not listen to the hover properties--*/
background: #fff;
border-bottom: 1px solid #fff; /*--Makes the active tab look like it's connected with its content--*/
}
.tab_container {
border: 1px solid #999;
border-top: none;
overflow: hidden;
clear: both;
float: left; width: 100%;
background: #fff;
}
.tab_content {
padding: 20px;
font-size: 1.2em;
}
3)  Belum siap ! Copy and paste code ni kat bawah code ]]></b:skin>

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js' type='text/javascript'/>
<script>
$(document).ready(function() {
$(&quot;.tab_content&quot;).hide(); //Hide all content
$(&quot;ul.tabs li:first&quot;).addClass(&quot;active&quot;).show(); //Activate first tab
$(&quot;.tab_content:first&quot;).show(); //Show first tab content
//On Click Event
$(&quot;ul.tabs li&quot;).click(function() {
$(&quot;ul.tabs li&quot;).removeClass(&quot;active&quot;); //Remove any &quot;active&quot; class
$(this).addClass(&quot;active&quot;); //Add &quot;active&quot; class to selected tab
$(&quot;.tab_content&quot;).hide(); //Hide all tab content
var activeTab = $(this).find(&quot;a&quot;).attr(&quot;href&quot;); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
return false;
});
});</script>
4) Preview dulu baru save. WAIT ! Belum habis lagi. Pergi Page Elements > Add Gadget > HTML/Javascript > Copy and paste code kat bawah ni kat dalam HTML/Javascript.

<style type="text/css">
h5 {
font-family: trebuchet-ms, arial, tahoma;
font-size: 13px;
padding: 0 0 1em;
font-weight:bold;
color: #ffffff;
}
.msg_list {
list-style: none;
margin: 0;
padding: 0;
width: 100%;
}
.msg_head {
padding: 5px 10px;
cursor: pointer;
position: relative;
background-color:#FFB6D6;
margin:1px;
-moz-border-radius: 35px;
border-radius: 35px;
}
.msg_body {
padding: 5px 10px 15px;
background-color:#FFFFFF;
}
</style>
<script type="text/javascript" src="https://sites.google.com/site/jquery01/tabmenuaccordion.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
//hide the all of the element with class msg_body
$(".msg_body").hide();
//slides the element with class "msg_body" when paragraph with class "msg_head" is clicked
$("#firstpane h5.msg_head").click(function()
{
$(this).next("div.msg_body").slideToggle(700).siblings("div.msg_body").slideUp("slow");
});
//slides the element with class "msg_body" when mouse is over the paragraph
$("#secondpane h5.msg_head").mouseover(function()
{
$(this).next("div.msg_body").slideDown("slow").siblings("div.msg_body").slideUp("slow");
});
});
</script>
<div class="msg_list" id="secondpane">
<h5 class="msg_head">Tajuk 1</h5>
<div class="msg_body">
<center>
Isi dalam tajuk 1</div>
<h5 class="msg_head">Tajuk 2</h5>
<div class="msg_body">
Isi dalam tajuk 2
</div>
<h5 class="msg_head">Tajuk 3</h5>
<div class="msg_body">
Isi dalam tajuk 3</div>
</div> 


ABC :  untuk warna tulisan navbar
ABC :  background navbar
ABC :  background isi navbar
ABC :  pilihlah tajuk apa yang korang nak letak
ABC :  letaklah segala kod yang korang nak





9 comments:

Anonymous said...

thanks for this tuto,lame dah cari sebenarnya,hehe...boleh tengok hasil di http://giveaway-only.blogspot.com/

fiqah hamed said...

wah..menjadi..nice tuto.. (:

Nurul Fatihah said...

Thanks...Alhamdulillah sebab menjadi...

admin said...

kenapa tak jadi? :(

Nurul Fatihah said...

Hah ? Tak jadi ? Hurm, macam mana yekk ??

Unknown said...

Thanks for the tutorial :) Berguna sangat! Saya nak re-post ye ^^ Jgn risau, always letak credit :D

Nurul Fatihah said...

OK ^^

Athikah said...

Tuto yang berguna.

Nurul Fatihah said...

Thanks ^_^

m
e
s
s
a
g
e

 
This blog+author+design fully edited and the designer is Nurul. Don't steal my design !