0

JSP 文件

 <a  href="#" onclick="pop('terms')> Terms of Use </a>
 | <a  href="#"  onclick="pop('privacy')"> Privacy Policy </a>
 | <a  href="#"  onclick="pop('contact')"> Contact Us / Advertise  


 <div id="dialog"> </div>

JS文件

 function pop(url){
  $("#dialog").dialog({
     modal:true,
     height:450,
     width:600,
     open: function(){
        if(url=="privacy")
        $("#dialog").load('/temp_privacy.jsp');
        if(url=="contact")
            $("#dialog").load('/temp_contact.jsp');
        if(url=="terms")
            $("#dialog").load('/temp_terms.jsp');
    },
       title: url.toUpperCase(),
    close: function(){
        $("#dialog").dialog('destroy');
    }
});

对于第一个请求对话框打开,文本在左侧对齐,每秒顶部对齐,对话框中的后续请求对齐是完全随机的,我无法理解导致这种行为的原因?

4

1 回答 1

0

without seeing your code, when you load pages like an ajax request your contents css is gettin g overridden somewhere from the rest of your body. make sure all your ids are unique and are not being styled elsewhere even in your jsp files. same with classes make sure they dont have some alt css that is being used by the same class somewhere else in your document

于 2012-08-21T04:33:23.857 回答