2011-04-07 5 views
0

링크를 클릭하면 jQuery 대화 상자가 열립니다. 대화 상자가 정상적으로 열리고 있지만 페이지가 스크롤되어 스크롤 될 때까지 대화 상자가 표시되지 않습니다. 어떻게 이것을 피할 수 있습니까?링크를 클릭 할 때 페이지 아래로 스크롤?

<script language="javascript" type="text/javascript"> 
    $(document).ready(function() { 
      jQuery("#waitDialog").dialog({ 

      autoOpen: false, 
      modal: true, 
      height: 375, 
      position: 'center', 
      width: 400, 
      draggable: true,     
      closeOnEscape: false, 
      open: function (type, data) { 
       $(".ui-dialog-titlebar-close").hide(); 
       $(this).parent().appendTo("form"); 
      } 
     }); 
    }); 
    function showDialog(id) { 
      $('#' + id).dialog("open");  
    } 
</script> 
<div id="waitDialog" style="display:none; cursor: default">   
    <table class="ms-authoringcontrols" style="border-top:1px black solid; border:1px black solid; height:70px " > 
    <tbody> 
      <tr> 
     <td class="ms-sectionheader ms-rightAlign"> 
      Please wait. 
     </td> 
      </tr> 
    </tbody> 
    </table> 
    </div> 

<map name="Map"> 
    <area shape="rect" coords="225,16,287,33" href="/_layouts/MyAlerts.aspx" onclick="javascript:showDialog('waitDialog');" alt="My Alerts"> 
</map> 
+0

링크 코드를 볼 수 있습니까? – mattsven

답변

1

당신의 연결을위한 .click() 이벤트해야 return false 그것은 id하여 요소로 이동합니다 페이지를 일으키는 원인이 다음되지 않도록.

$('a').click(function() { 
    showDialog($(this).attr('href')) 
    return false; 
}); 
0

앵커 태그에 문제가있는 것 같습니다. 대신 href="/_layouts/MyAlerts.aspx"

의 사용자가 사용할 수 있습니다

onclick='window.location = "/_layouts/MyAlerts.aspx"; 
관련 문제