No problem.
HTML:
Code:
<div id="ALL">
<div id="TAB1" class="tabHead" onclick="front(1);"><p>Phone/Fax</p></div>
<div id="TAB2" class="tabHead" onclick="front(2);" style="left: 255px;"><p>Email</p></div>
<div id="TAB3" class="tabHead" onclick="front(3);" style="left: 395px;"><p>Post</p></div>
<div id="TABBODY1" class="tabBody">
</div>
<div id="TABBODY2" class="tabBody">
</div>
<div id="TABBODY3" class="tabBody">
</div>
</div>
CSS:
Code:
div#ALL {width: 40%;
position: relative;
left: 11em;
height: 9em;
margin-top: 3em;}
div#ALL p {margin-top: 0.15em;}
div.tabBody {position: absolute;
top: 0px;
left: 5em;
width: 100%;
height: 100%;
z-index: 1;
background-color: #8d581d;
border: 1px solid #000;
padding: 20px;
-moz-border-radius-topright: 20px;
border-top-right-radius: 20px;
-moz-border-radius-topleft: 20px;
border-top-left-radius: 20px;
-moz-border-radius-bottomleft: 20px;
border-bottom-left-radius: 20px;
-moz-border-radius-bottomright: 20px;
border-bottom-right-radius: 20px;}
div.tabHead {position: absolute;
top: -20px;
left: 7em;
width: 100px;
height: 22px;
z-index: 2;
text-align: center;
background-color: #fff;
border: 1px solid #000;
border-bottom: none;
cursor: pointer;
-moz-border-radius-topright: 10px;
border-top-right-radius: 10px;
-moz-border-radius-topleft: 10px;
border-top-left-radius: 10px;}
#TABBODY2 span a:link {color: #fff;
font-family: tahoma;
font-size: 10pt;
letter-spacing: 2px;}
#TABBODY2 span a:visited {color: #3f9c3f;
font-family: tahoma;
font-size: 10pt;
letter-spacing: 2px;}
#TABBODY2 span a:hover {color: #000;
text-decoration: underline;
font-family: tahoma;
font-size: 10pt;
letter-spacing: 2px;}
JS:- put in the head section of your html.
Code:
<script type="text/javascript">
function front(which)
{
for ( var t = 1; t < 9999; ++t )
{
var dv = document.getElementById("TABBODY"+t);
if ( dv == null ) return;
dv.style.zIndex = t == which ? 5 : 1;
var tab = document.getElementById("TAB"+t);
tab.style.backgroundColor = t == which ? "#8d581d" : "white";
tab.style.textDecoration = t == which ? "underline" : "none";
tab.style.zIndex = t == which ? 7 : 1;
}
}
</script>
Brilliant code. Obviously, have a look through the concept of the javascript and it's quite simple really, but a really good script. You can see the basics of how it works so you should really be able to edit it to suit yourself.
Kind regards,
LC.