Making Tab using Javascript Posted on: September 29, 2008 By Deepak Kumar
This Example describes the way to make Tab using javascript and css.For this we are going to make program named domtab.css, domtab.js, index.html.
Making Tab using
Javascript
This Example describes the way to make Tab using javascript and css.For this we are going to make program named
domtab.css, domtab.js, index.html. The code involved in programs are described below:-
index.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Example of making Ajax tab</title>
<style type="text/css">
@import "domtab.css";
</style>
<script type="text/javascript" src="domtab.js"></script>
<script type="text/javascript">
document.write('<style type="text/css">');
document.write('div.domtab div{display:none;}<');
document.write('/s'+'tyle>');
</script>
</head>
<body>
<h1><a name="top" id="top">Ajax-Tab Example</a></h1>
<p id="domtabprintview"></p>
<div class="domtab">
<ul class="domtabs">
<li><a href="#what">What is DOMtab?</a></li>
<li><a href="#how">How to use DOMtab</a></li>
<li><a href="#pr">Previous and next links</a></li>
<li><a href="#style">How to style DOMtab</a></li>
</ul>
<div>
<h2><a name="what" id="what">What is Dom Tab</a></h2>
<p>DOMtab is a JavaScript that turns a list of links connected
to content sections into a tab interface.The script removes any "back to top" links in the section and automatically hides all
but the first one when the page is loaded.</p>
</div>
<div>
<h2><a name="how" id="how">How to use DOMtab</a></h2>
<p>Applying DOMtab to your pages is easy, all you need is
to call the script in the head of the document:</p>
</div>
<div>
<h2><a name="pr" id="pr">Previous and next links</a></h2>
<p>In this version I added the option to have previous and
next links
<p>DOMtab then generates the
following link list in each of the sections, automatically
removing the previous link in the first and the next in the
last section:</p>
</pre>
<p>Both labels are set via innerHTML rather than the proper
method :-).
This allows you to
use images if wanted:</p>
</div>
<div>
<h2><a name="style" id="style">How to style DOMtab</a></h2>
<p>Using the mandatory classes domtab for the main DIV of
each menu,and domtabs for the menu list,you can pretty
much style your menus any way you want to.</p>
</pre>
</div>
</body>
</html>
Prayag
June 25, 2011
Really good example
Really a nice example. Nothing less so that I dont get knowledge and nothing more so that I get bogged down.
Regards,
Prayag
ehsan
August 16, 2011
tanx
Tanx, Its very good
javed salmani
April 6, 2012
html
discribe brief of HTML FRAME, and using HTML images tags
Ask Questions? Discuss: Making Tab using Javascript View All Comments
Post your Comment