I am having a problem turning one element on and the other off in the same div. It seems I create an object that is supposed to do this, and when I click on it, it hides the entire div instead of turning one element on and one off. What else do I need to add to make this work?
CSS
#test1 {
width:804px; margin-left:auto; margin-right:auto; height:250px; float:left; overflow:hidden; display:none;
}
#test2 {
width:804px; margin-left:auto; margin-right:auto; height:250px; float:left; overflow:hidden; display:block;
}
.mydiv {
}
#test {
width:804px; margin-left:auto; margin-right:auto; height:250px; float:left; overflow:hidden;
}
#labor{
float:left; width:38px; height:125px;
}
#odc {
float:left; width:32px; height:125px;
}
HTML
<div id="test">
<div class="mydiv" id="test1">
<script src="../../Dashboard/Charts/FusionCharts.js" type="text/javascript"></script>
<div id="line3ChartContainer" style="display:normal">
<asp:Literal ID="Literal9" Visible="true" runat="server"></asp:Literal></div>
</div>
<div class="mydiv" id="test2">
<script src="../../Dashboard/Charts/FusionCharts.js" type="text/javascript"></script>
<div id="popChartContainer" style="display:normal">
<asp:Literal ID="Literal3" Visible="true" runat="server"></asp:Literal></div>
</div>
</div>
<img src="../../images/labortab.png" id="labor" onmousedown="document.test1.visibility='false';document.test2.visibility='true';"/>
<img src="../../images/odctab.png" id="odc" onmousedown="document.test1.visibility='true';document.line3ChartDiv.visibility='false';"/>
Hope this is better looking.
onmousedown
is so 90-ish, please use unobtrusive even handlers. – moonwave99jQuery.hide()
– Mgetz