我试图做一个融合图交换,但asp不喜欢这样做。所以下一个最好的事情就是融合图表渲染,然后用onmousedown代替图表。只有这一点不太好。我曾尝试在代码中添加div并使用id,但交换不起作用。我在document.popChartDiv.src中使用了'popChartDiv',但是这个ID是调用Literal3的渲染。我不知道如何切换Literal3与它下面的2格(testimage.png和testimage1.png)。看起来图表是焦点,图像无法覆盖图表。我也尝试过使用z-index,但那不起作用。所以我卡住了。融合图交换
<div style="width:798px; margin-left:auto; margin-right:auto; height:250px; float:left; overflow:hidden;" id="popChartDiv">
<script src="../../Dashboard/Charts/FusionCharts.js" type="text/javascript"></script>
<div id="popChartContainer"></div>
<asp:Literal ID="Literal3" Visible="true" runat="server"></asp:Literal>
<div id="line3ChartContainer"></div>
<asp:Literal ID="Literal9" Visible="true" runat="server"></asp:Literal>
<img src="/images/testimage.png" width="798" height="250" name="swap"/>
</div>
<div style="width:38px; height:250px; float:left;">
<img src="../../images/labortab.png" style="float:left; width:38px; height:125px;" id="labor" onmousedown="document.swap.src='/images/testimage.png';"/>
<img src="../../images/odctab.png" style="float:left; width:38px; height:125px;" id="odc" onmousedown="document.swap.src='/images/testimage1.png';"/>
<script type="text/javascript">
$('#labor').hover(function() {
$(this).attr('src', '/images/labortabhover.png');
}, function() {
$(this).attr('src', '/images/labortab.png');
});
$('#odc').hover(function() {
$(this).attr('src', '/images/odctabhover.png');
}, function() {
$(this).attr('src', '/images/odctab.png');
});
</script>
</div>
什么是图表的ID?它是'line3Chart'? –