I am trying to toggle image, i searched the net but could not find appropriate solution for my scene. I have three buttons on right side tabbed menu. By default it loads first DIV then when i click on second button it loads second div similar for third. Now i the button has an image in background. I want to show which div is active by toggling the image
Now see this image this is my menu the first one is active this is a li tag and i have set the background to that li now when i click on second tab i want to change the image in three tabs as : the first will be with line and the one active without line..
Maybe its too confusing :(
here's the code::
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
</head>
<body>
<div id="tabs">
<ul style="float:right">
<li>
<a href="#a" class="clickable"></a>
</li>
<li>
<a href="#b" class="bizrtc"></a>
</li>
<li>
<a href="#c" class="lab"></a>
</li>
</ul>
<div id="a">
<object type="text/html" data="home.html" width="1280px" height="720px" style="overflow:auto;"> </object>
</div>
<div id="b">
<object type="text/html" data="contact.html" width="1280px" height="720px" style="overflow:auto;"></object>
</div>
<div id="c">
<object type="text/html" data="blog.html" width="1280px" height="720px" style="overflow:auto;"></object>
</div>
</div>
<script>
$("#siteloader").html('<object data="home.html">');
</script>
<style type="text/css">
.ui-tabs.ui-tabs-vertical {
padding: 0;
width: 104%;
}
.ui-tabs.ui-tabs-vertical .ui-widget-header {
border: none;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav {
float: left;
width: 4em;
border-radius: 4px 0 0 4px;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li {
clear: left;
width: 100%;
margin: -52px 0px;
height: 230px;
border-width: 1px 0 1px 1px;
border-radius: 4px 0 0 4px;
overflow: hidden;
position: relative;
right: 38px;
z-index: 2;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li a {
display: block;
width: 100%;
padding: 0.6em 1em;
height: inherit;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li a:hover {
cursor: pointer;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -52px;
padding-bottom: 0;
border-right: 1px solid white;
height: 230px;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-nav li:last-child {
margin-top: -52px;
}
.ui-tabs.ui-tabs-vertical .ui-tabs-panel {
float: left;
width: 28em;
border-left: 1px solid gray;
border-radius: 0;
position: relative;
left: -1px;
}
.clickable {
background: url(buttons/umobility_button_active.png) no-repeat 6px center;
}
.bizrtc {
background: url(buttons/labs_button.png) no-repeat 6px center;
}
.lab {
background: url(buttons/rtcbiz_button.png) no-repeat 6px center;
}
}
</style>
</body>
<script type="text/javascript">
$('#tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
</script>
</html>