js鼠标事件
<div><asp:Labelrunat="server"ID="lpic1"Text="图片"onmouseover="Ppic1_onmouseover()"></a...
<div>
<asp:Label runat="server" ID="lpic1" Text="图片" onmouseover="Ppic1_onmouseover()"></asp:Label>
<asp:Label runat="server" ID="lpic2" Text="全景" onmouseover="Ppic2_onmouseover()"></asp:Label>
<asp:Label runat="server" ID="lpic3" Text="特景" onmouseover="Ppic3_onmouseover()"></asp:Label>
<%--<asp:LinkButton ID="pic1" runat="server" OnClick="pic1_Click">图片</asp:LinkButton>
<asp:LinkButton ID="pic2" runat="server" OnClick="pic2_Click">全景图</asp:LinkButton>
<asp:LinkButton ID="pic3" runat="server" OnClick="pic3_Click">特景图</asp:LinkButton>--%>
</div>
<div style="display: inline">
<div style="height: 390px; width: 354px; float: left">
<div ID="dpic1" runat="server" visible="true">
<asp:Image ID="Image1" runat="server" Height="350px" Width="350px" ImageAlign="Middle"
ImageUrl="~/image/beijing2.jpg" />
</div>
<div ID="dpic2" runat="server" visible="true">
<asp:Image ID="Image2" runat="server" Height="350px" Width="350px" ImageAlign="Middle"
ImageUrl="~/image/beijing3.jpg" />
</div>
<div ID="dpic3" runat="server" visible="true">
<asp:Image ID="Image3" runat="server" Height="350px" Width="350px" ImageAlign="Middle"
ImageUrl="~/image/beijing4.jpg" />
</div>
<div ID="dPanel3" runat="server" width="694px">
<asp:Image ID="Image4" runat="server" Height="40px" Width="150px" ImageAlign="Middle"
ImageUrl="~/image/beijing4.jpg" />
</div>
</div>
</div>
<script type="text/javascript" language="javascript">
var dpic1=document.getElementById("dpic1");
var dpic2=document.getElementById("dpic2");
var dpic3=document.getElementById("dpic3");
function Ppic1_onmouseover()
{
dpic1.style.display="block";
dpic2.style.display="none";
dpic3.style.display="none";
}
function Ppic2_onmouseover()
{
dpic3.style.display="none";
dpic1.style.display="none";
dpic2.style.display="block";
}
function Ppic3_onmouseover()
{
document.getElementById("dpic3").visible=true;
document.getElementById("dpic1").visible=false;
document.getElementById("dpic2").visible=false;
}
</script>
为什么会提示document.getElementById("****")为空或不是对象呢?dpic*为空或不是对象? 展开
<asp:Label runat="server" ID="lpic1" Text="图片" onmouseover="Ppic1_onmouseover()"></asp:Label>
<asp:Label runat="server" ID="lpic2" Text="全景" onmouseover="Ppic2_onmouseover()"></asp:Label>
<asp:Label runat="server" ID="lpic3" Text="特景" onmouseover="Ppic3_onmouseover()"></asp:Label>
<%--<asp:LinkButton ID="pic1" runat="server" OnClick="pic1_Click">图片</asp:LinkButton>
<asp:LinkButton ID="pic2" runat="server" OnClick="pic2_Click">全景图</asp:LinkButton>
<asp:LinkButton ID="pic3" runat="server" OnClick="pic3_Click">特景图</asp:LinkButton>--%>
</div>
<div style="display: inline">
<div style="height: 390px; width: 354px; float: left">
<div ID="dpic1" runat="server" visible="true">
<asp:Image ID="Image1" runat="server" Height="350px" Width="350px" ImageAlign="Middle"
ImageUrl="~/image/beijing2.jpg" />
</div>
<div ID="dpic2" runat="server" visible="true">
<asp:Image ID="Image2" runat="server" Height="350px" Width="350px" ImageAlign="Middle"
ImageUrl="~/image/beijing3.jpg" />
</div>
<div ID="dpic3" runat="server" visible="true">
<asp:Image ID="Image3" runat="server" Height="350px" Width="350px" ImageAlign="Middle"
ImageUrl="~/image/beijing4.jpg" />
</div>
<div ID="dPanel3" runat="server" width="694px">
<asp:Image ID="Image4" runat="server" Height="40px" Width="150px" ImageAlign="Middle"
ImageUrl="~/image/beijing4.jpg" />
</div>
</div>
</div>
<script type="text/javascript" language="javascript">
var dpic1=document.getElementById("dpic1");
var dpic2=document.getElementById("dpic2");
var dpic3=document.getElementById("dpic3");
function Ppic1_onmouseover()
{
dpic1.style.display="block";
dpic2.style.display="none";
dpic3.style.display="none";
}
function Ppic2_onmouseover()
{
dpic3.style.display="none";
dpic1.style.display="none";
dpic2.style.display="block";
}
function Ppic3_onmouseover()
{
document.getElementById("dpic3").visible=true;
document.getElementById("dpic1").visible=false;
document.getElementById("dpic2").visible=false;
}
</script>
为什么会提示document.getElementById("****")为空或不是对象呢?dpic*为空或不是对象? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询