在這裏我有一個div,在鼠標懸停在主頁面和鼠標懸停後,三個href鏈接將出現在該div中。在單擊該鏈接後,它正在遍歷另一個頁面,發生回發, DIV是越來越隱藏在主page.I需要證明點擊also.I已經使用的UpdatePanel後的div和嘗試過,但它仍然不是working.here是我的代碼如何在點擊按鈕回發後顯示div?
//股利部分
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="Update" runat="server">
<ContentTemplate>
<div runat="server" class="divSUBMenu" id="describe" style="width: 700px; height: 20px;
font: Arial, Helvetica, sans-serif;" onclick="show(0)">
</div>
</ContentTemplate>
</asp:UpdatePanel>
// onHover選項部分
<a href="#" onmouseover="showit(0)">
<img src="Images/Analyze_over.jpg" name="image1" width="84" height="22" border="0"
id="image1" alt="" /></a>
// JavaScript進行mousehover(做工精細)
var submenu = new Array();
submenu[0] = ' <font style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><a style="color: #FFFFFF; text-decoration: none;" href="ATrendAnalysis.aspx">Trend Analysis</a> <a style="color: #FFFFFF; text-decoration: none;" href="AEventPerformance.aspx">Event Performance</a> <a style="color: #FFFFFF; text-decoration: none;" href="ACannibalization.aspx">Cannibalization</a> <a style="color: #FFFFFF; text-decoration: none;" href="AHaloEffect.aspx">Halo Effect</a> <a style="color: #FFFFFF; text-decoration: none;" href="AVolumeDecomposition.aspx">Volume Decomposition</a></font></span>';
var delay_hide = 500;
var menuobj = document.getElementById ? document.getElementById("describe") : document.all ? document.all.describe : document.layers ? document.dep1.document.dep2 : "";
function showit(which) {
clear_delayhide();
document.getElementById("describe").style.visibility = 'visible';
thecontent = (which == -1) ? "" : submenu[which];
if (document.getElementById || document.all) {
menuobj.innerHTML = thecontent;
}
else if (document.layers) {
menuobj.document.write(thecontent);
menuobj.document.close();
}
}
終於下面的部分不是的onclick期間工作,但這個警告是工作
function show(which) {
alert("test");
document.getElementById("describe").style.visibility = 'visible';
}
任何建議?
編輯: 這是在href我點擊
<a style="color: #FFFFFF; text-decoration: none;" href="ATrendAnalysis.aspx">Trend Analysis</a>
嘗試'document.getElementById(「describe」)。setAttribute(「style」,「display:block;」);'它可能工作。 – Murtaza 2012-03-21 11:06:31
我已嘗試也仍然沒有工作 – bala3569 2012-03-21 11:09:26