Jumat, 30 November 2012
Contoh Tab Css Menu sederhana
Baik lah teman-taman.. kali ini saya ingin memposting source code css,yaitu membuat tab sederhana yang di dapat kan di link ilmuwebsite.com semoga bermanfaat. terimakasih
silahkan di copy script di bawah ini :
<style type="text/css">
#tabs {display: block;float: left;width: 160px;}
.panel {border: solid 1px #D8D8D8;border-top: none;background-color: #FFFFFF;padding: 0px;width: 500px;overflow: auto;clear: left;}
.tab_bdr{padding: 0px;width: 500px;border: 0px;border: 1px solid #645DB5;height: 4px;margin:0px;background: #645DB5;clear: left;font-size: 0px;}
.tab{font-family:tahoma; FONT-SIZE: 11px;background:#BA0808;color:#FFFFFF;cursor:pointer;border:none;border-bottom: 1px solid #FFFFFF;height:19px;padding-top:3px;margin:0px;width:60px; float:left; text-decoration:none;}
.tab_sel{font-family:tahoma; FONT-SIZE: 11px;background:#645DB5;color:#FFFFFF;cursor:pointer;border:none;border-bottom:1px solid #645DB5;height:19px;padding-top:3px;margin:0px;width:60px; float:left; text-decoration:none;}
</style>
<script language="JavaScript" type="text/javascript">
var panels = new Array('panel1', 'panel2'); // IDs of the content panels must be put here
var tabs = new Array('tab1', 'tab2'); // IDs of the tabs must be put here
function displayPanel(nval)
{
for(i = 0; i < panels.length; i++)
{
document.getElementById(panels[i]).style.display = (nval-1 == i) ? 'block':'none';
document.getElementById(tabs[i]).className=(nval-1 == i) ? 'tab_sel':'tab';
}
}
</script>
<div id="tabs">
<div id="tab1" class="tab_sel" align="center" onClick="javascript: displayPanel('1');">Tab 1</div>
<div id="tab2" class="tab" style="margin-left:1px;" align="center" onClick="javascript: displayPanel('2');">Tab 2</div>
</div>
<div class="tab_bdr"></div> <!-- This is the div used to show a thick border below the tab and above the panel-->
<div class="panel" id="panel1" style="display: block">Ini tab 1</div> <!-- The display panels for the respective tabs can be put here -->
<div class="panel" id="panel2" style="display: none">Ini tab 2</div>
hasil nya :


0 Responses to “Contoh Tab Css Menu sederhana”
Posting Komentar