15 Maret 2013
0

Langkah :
1. Login ke Blogger
2. Pilih Tata Letak => Tambah Gadget
3. Pilih HTML/JavaScript
4. Masukkan kode dibawah ini kedalamnya

<style type="text/css">
div.TabView div.Tabs a{
float:left; display:block; width:32%; height: 33px;
text-align:center; margin:2px 0px 0px 3px;
background-color:#fff; padding-top:7px;
border:1px solid #BFBEBE; border-bottom:1px solid #BFBEBE;
font-family:"Arial, Helvetica, sans-serif", Arial; font-weight:normal; color:#333;
}
div.TabView div.Tabs a:hover, div.TabView div.Tabs a.Active{border:2px solid #555; background-color:#555; color:#fff;}
div.TabView div.Pages{clear:both; border:1px solid #cccccc; overflow:hidden; background-color:#ffffff;}
div.TabView div.Pages div.Page{height:100%; padding:0px 15px; overflow: hidden;}
div.TabView div.Pages div.Page div.Pad{padding: 3px 5px;}
</style>
<script type='text/javascript'>//<![CDATA[
function tabview_aux(TabViewId, id){
 var TabView = document.getElementById(TabViewId);
 // ----- Tabs -----
 var Tabs = TabView.firstChild;
 while (Tabs.className != "Tabs" ) Tabs = Tabs.nextSibling;
 var Tab = Tabs.firstChild;
 var i   = 0;
 do{
  if (Tab.tagName == "A"){
   i++;
   Tab.href = "javascript:tabview_switch('"+TabViewId+"', "+i+");";
   Tab.className = (i == id) ? "Active" : "";
   Tab.blur();
  }
 }
 while (Tab = Tab.nextSibling);
 // ----- Pages -----
 var Pages = TabView.firstChild;
 while (Pages.className != 'Pages') Pages = Pages.nextSibling;
 var Page = Pages.firstChild;
 var i    = 0;
 do{
  if (Page.className == 'Page'){
   i++;
   if (Pages.offsetHeight) Page.style.height = (Pages.offsetHeight-2)+"px";
   Page.style.overflow = "auto";
   Page.style.display  = (i == id) ? 'block' : 'none';
  }
 }
 while (Page = Page.nextSibling);
}
// ----- Functions
function tabview_switch(TabViewId, id) { tabview_aux(TabViewId, id); }
function tabview_initialize(TabViewId) { tabview_aux(TabViewId,  1); }
//]]></script>
<form action="tabview.html" method="get">
<div id="TabView" class="TabView">
 <div style="width: 100%;" class="Tabs">
  <a>TAB 01</a>
  <a>TAB 02</a>
  <a>TAB 03</a>
 </div>
 <div style="width:100%; height:300px; " class="Pages">
  <div class="Page">
  <div class="Pad">
   KONTEN 1
  </div>
  </div>

  <div class="Page">
  <div class="Pad">
   KONTEN 2
  </div>
  </div>

  <div class="Page">
  <div class="Pad">
   KONTEN 3
  </div>
  </div>
 </div>
</div>
</form>
<script type="text/javascript">tabview_initialize('TabView');</script>

Keterangan :
- Yang berwarna merah adalah judul tab.
- Yang berwarna biru adalah isi dari tab
Sumber : www.maskolis.comwww.blogdhika.com

0 comments:

Posting Komentar