tabulu HTML
Code
<ul id="tabs">
<li><a href="##" name="#tab1" id="current">One</a></li>
<li><a href="##" name="#tab2">Two</a></li>
<li><a href="##" name="#tab3">Three</a></li>
<li><a href="##" name="#tab4">Four</a></li>
</ul>
<div id="content">
<div id="tab1" style="display: block; ">
<h2>uCozwebmeistars - uCoz sistemas 'e-vides' paligs majaslapu izstrade</h2>
<p>
uCozwebmeistars radas 2011. gada janvari, kuru izveidoja Korijs (Rinalds B.), veloties radit portalu, kurs attistitu latviesu zinasanas uCoz sistema un tas piedavataja bezmaksas majaslapu izveide, apmacot jaunos un potencialos uCoz lietotajus darba ar so sistemu. Jau sakotneji portals piedava galvenas pamattemas materialu zina saistiba ar apmacibu - Pamacibas, skripti, majaslapu dizaini, vizualie materiali, tehniska palidziba, ievads HTML & CSS u.c. noderiga informacija, rupejoties par to, lai katra zinasanas uCoz vide augtu - attistitos, kas ari ir noticis, kops UW rasanas. Protams, laika gaita tiek domats ari par nemitigu attistibu, atjauninot portala saturu, uzlabojot to kopuma!</p>
<h3>Pellentesque habitant</h3>
<p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae.</p>
</div>
<div id="tab2" style="display: none; ">
<h2>Vivamus fringilla suscipit justo</h2>
<p>Aenean dui nulla, egestas sit amet auctor vitae, facilisis id odio. Donec dictum gravida feugiat.</p>
<p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras pretium elit et erat condimentum et volutpat lorem vehicula</p>
<p>Morbi tincidunt pharetra orci commodo molestie. Praesent ut leo nec dolor tempor eleifend.</p>
</div>
<div id="tab3" style="display: none; ">
<h2>Phasellus non nibh</h2>
<p>Non erat laoreet ullamcorper. Pellentesque magna metus, feugiat eu elementum sit amet, cursus sed diam. Curabitur posuere porttitor lorem, eu malesuada tortor faucibus sed.</p>
<h3>Duis pulvinar nibh vel urna</h3>
<p>Donec purus leo, porttitor eu molestie quis, porttitor sit amet ipsum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec accumsan ornare elit id imperdiet. </p>
<p>Suspendisse ac libero mauris. Cras lacinia porttitor urna, vitae molestie libero posuere et. </p>
</div>
<div id="tab4" style="display: none; ">
<h2>Cum sociis natoque penatibus</h2>
<p>Magnis dis parturient montes, nascetur ridiculus mus. Nullam ac massa quis nisi porta mollis venenatis sit amet urna. Ut in mauris velit, sed bibendum turpis.</p>
<p>Nam ornare vulputate risus, id volutpat elit porttitor non. In consequat nisi vel lectus dapibus sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent bibendum sagittis libero.</p>
<h3>Imperdiet sem interdum nec</h3>
<p>Mauris rhoncus tincidunt libero quis fringilla.</p>
</div>
</div>
JS, kuru novietojam turpat uzreiz zem tabulām
Code
<script src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
function resetTabs(){
$("#content div").hide(); //Hide all content
$("#tabs a").attr("id",""); //Reset id's
}
var myUrl = window.location.href; //get URL
var myUrlTab = myUrl.substring(myUrl.indexOf("#")); // For localhost/tabs.html#tab2, myUrlTab = #tab2
var myUrlTabName = myUrlTab.substring(0,4); // For the above example, myUrlTabName = #tab
(function(){
$("#content div").hide(); // Initially hide all content
$("#tabs li:first a").attr("id","current"); // Activate first tab
$("#content div:first").fadeIn(); // Show first tab content
$("#tabs a").on("click",function(e) {
e.preventDefault();
if ($(this).attr("id") == "current"){ //detection for current tab
return
}
else{
resetTabs();
$(this).attr("id","current"); // Activate this
$($(this).attr('name')).fadeIn(); // Show content for current tab
}
});
for (i = 1; i <= $("#tabs li").length; i++) {
if (myUrlTab == myUrlTabName + i) {
resetTabs();
$("a[name='"+myUrlTab+"']").attr("id","current"); // Activate url tab
$(myUrlTab).fadeIn(); // Show url tab content
}
}
})()
</script>
ielādējam savā ftp šo js kas atrodams pielikumā zip failā, iekš mapes js