2011-06-28 7 views
0

私はaspxページ(jsddm)に「メニューバー」の並べ替えがあります。項目は、マウスがトップレベルメニュー項目の上を移動すると表示され、マウスが離れると消えます。私の仮想マシンでF5キーを押したとき、それはうまくいきます(私のVMはWin 2003サーバーを実行し、IE 8.0.6001.18702を使用し、VS2008も実行します)。ASP.NET li/ulタグ付き 'Menu' not working

しかし、(同じVMにIISでホストされている)公開し、通常のマシン(IE 8.0.7600.16385のWin 7)から表示しようとすると、小さなバグは正しく動作しません。

これがなぜ大変ありがとうございますか?ありがとう!

ここでは、私が話しているかを見ることができるようにコードです:あなたのページが生成されるHTMLマークアップを見ず

#jsddm 
{ margin: 0; 
    padding: 0;} 

#jsddm li 
{ float: left; 
    list-style: none; 
    font: 12px Tahoma, Arial;} 

#jsddm li a 
{ display: block; 
    background: #20548E; 
    padding: 5px 12px; 
    text-decoration: none; 
    border-right: 1px solid white; 
    width: 70px; 
    color: #EAFFED; 
    white-space: nowrap;} 

#jsddm li a:hover 
{ background: #1A4473;} 

    #jsddm li ul 
    { margin: 0; 
     padding: 0; 
     position: absolute; 
     visibility: hidden; 
     border-top: 1px solid white;} 

    #jsddm li ul li 
    { float: none; 
     display: inline;} 

    #jsddm li ul li a 
    { width: auto; 
     background: #9F1B1B;} 

    #jsddm li ul li a:hover 
    { background: #7F1616;} 

    #GetPolicy 
    { text-align: left;} 

    .style1 
    { 
     width: 100%; 
    } 
    .style2 
    { 
     width: 282px; 
    } 

    .style3 
    { 
     height: 100px; 
    } 
    .style4 
    { 
     height: 100px; 
     width: 303px; 
    } 
    .style5 
    { 
     width: 303px; 
    } 

    #ltrVariables 
    { 
     width: 553px; 
     height: 329px; 
    } 

    .style6 
    { 
     width: 358px; 
    } 

    .style7 
    { 
     width: 228px; 
    } 

    .ModalPopupBG 
    { 
    background-color: #666699; 
    filter: alpha(opacity=50); 
    opacity: 0.7; 
    } 

    .HellowWorldPopup 
    { 
    min-width:200px; 
    min-height:100px; 
    background:white; 
    border-color:Silver; 
    border-style:ridge; 
    border-width:medium; 

    } 
    .HeaderStyle 
    { 
    color:Black; 
    background-color:Black; 
    border-style:solid; 
    } 
    .PopupHeader 
    { 
    color:Black; 
    background-color:white; 
    } 
    .style8 
    { 
     height: 20px; 
    } 
    </style> 



</head> 
<body leftmargin="0" topmargin="0" 
background="Images/tile-grey-stripe.jpg"> 
<form id="Form1" defaultbutton="GetPolicy" runat="server"> 



    <table width="1000" height="99" border="0" align="center" cellpadding="0" cellspacing="0"> 
     <tr> 
      <td width="35" background="../Images/a_ag01.jpg"></td> 
      <td width="524"><img src="Images/a_ag1.jpg" alt="" width="524" height="99" border="0" align="top" /></td> 
      <td width="389"> 
       <table border="0" cellspacing="0" cellpadding="0" width="389"> 
        <tr> 
         <td width="218"><img id="imgHeader" src="Images/text_title_producer1.jpg" style="height:99px;width:218px;border-width:0px;" /></td> 
      <td width="111"><img id="imgHeadr2" src="Images/text_title-TILE.jpg" style="height:99px;width:171px;border-width:0px;" /></td> 
        </tr> 
       </table> 
      </td> 
      <td width="19" align="right"><img src="Images/a_ag4_end.jpg" width="19" height="99" alt="" /></td> 
      <td align="right" width="33" background="Images/a_ag5.jpg"></td> 
     </tr> 
    </table> 
    <!--end of the header table --> 
    <table height="702" width="1000" border="0" cellpadding="0" cellspacing="0" align="center"> 
     <tr> 
      <td width="70" background="Images/b_ag1_lefttile.jpg"> <!-- This is the left wall of the form !--> 
       &nbsp;</td> 
      <td width="880" valign="top" bgcolor="#FFFFFF"> 
<!-- Text, controls, buttons, etc goes below this comment. !--> 

<script src="/App_Themes/Default/jquery.js" type="text/javascript"></script>  
<script type="text/javascript"> 
var timeout = 500; 
var closetimer = 0; 
var ddmenuitem = 0; 

function PrintBatchJS() 
{if(confirm("Send the ENTIRE batch to printing? (All letters will be removed from system)")) 
{var PDFval = document.getElementById('<%= pnlPDF.clientID %>'); 
if (PDFval == null) 
    {if (confirm("Send the entire batch to print and delete them from the database?")) 
     {document.cookie="PDF=True"; 
     window.location = "../Main.aspx";}}}} 

function ViewBatchJS() 
{var PDFval = document.getElementById('<%= pnlPDF.clientID %>'); 
if (PDFval == null) 
     {document.cookie="PDF=True"; 
     document.cookie="View=True"; 
     window.location = "../Main.aspx";}} 

function ShowModal() 
{$find('ModalPopupExtender1').show()}; 

function ShowConditionalModal() 
{if (document.getElementById("<%= txtPolicyNo.clientID %>").value != "") 
    if (Page_IsValid) 
    {$find('ModalPopupExtender1').show()}}; 

function HideModal() 
{$find('ModalPopupExtender1').hide();} 

function InvalidClientNumber() 
{alert("Wrong Number."); } 


function GetLetterForm() 
{$find('ModalPopupExtender1').show(); 
document.ltrVariables.location = document.getElementById("<%= lstNames.clientID %>").value + ".aspx"; 
document.getElementById("<%= lstNames.clientID %>").disabled = true; 
document.getElementById("<%= txtPolicyNo.clientID %>").disabled = true; 
document.getElementById("<%= GetPolicy.clientID %>").disabled = true; 
$find('ModalPopupExtender1').hide();} 

function ResetPanel() 
{__doPostBack('pnlMaster', 'PanelReset');} 

function GoToBatchOps() 
{window.location = "../BatchOperations.aspx";} 

function LogOut() 
{window.location = "../Login.aspx";} 

function jsddm_open() 
{ jsddm_canceltimer(); 
jsddm_close(); 
ddmenuitem = $(this).find('ul').css('visibility', 'visible');} 

function jsddm_close() 
{ if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');} 

function jsddm_timer() 
{ closetimer = window.setTimeout(jsddm_close, timeout);} 

function jsddm_canceltimer() 
{ if(closetimer) 
{ window.clearTimeout(closetimer); 
    closetimer = null;}} 

$(document).ready(function() 
{ $('#jsddm > li').bind('mouseover', jsddm_open) 
$('#jsddm > li').bind('mouseout', jsddm_timer)}); 

document.onclick = jsddm_close; 
</script> 

<ul id="jsddm"> 
<li><a href="#">File</a> 
    <ul> 
     <li><a onclick="__doPostBack('pnlMaster', '');">New Policy</a></li> 
     <li><a onclick="PrintBatchJS()">Print Batch</a></li> 
     <li><a onclick="ViewBatchJS()">View Batch</a></li> 
     <li><a onclick="LogOut()">Log Out</a></li> 
    </ul> 
</li> 
<li><a href="#">Tools</a> 
    <ul> 
     <li><a onclick="GoToBatchOps()">Batch Operations</a></li>    
    </ul> 
</li> 
<li><a href="#">Help</a> 
    <ul> 

     <li><a onclick="LogOut()">Contents</a></li> 
    </ul> 
</li> 
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true"> 
         </asp:ToolkitScriptManager> 
</ul> 

答えて

1

、それは問題をピンポイントするのは難しいが。 JSDDMがJquery Simpleドロップダウンメニューの場合、問題はVSがデフォルトでWebサイトを起動する仮想ディレクトリである可能性があります。

ie。 'www'という新しいウェブサイトを設定すると、ローカルURLはデフォルトで 'http:// localhost:8123/www /'のようになります。ただし、公開した後にIISを使用している場合、公開フォルダを指しているだけの場合、URLは「http:// localhost /」になります。 スクリプトタグを確認し、JavaScriptがロードされているURLを確認します。 '/ www /'からロードされている場合、URLはIISサイトでは有効ではありません。

これらの種類の問題を回避するために、私は通常、VSウェブサイトの設定から仮想ディレクトリを削除します。

+0

ポストに感謝します。調べに来て、それはディレクトリの問題だった。私のjqueryリファレンスは、に変更する必要がありました。違いはただ一つの小さな「/」だけでした。 –