直接上图:现在的问题是用户在点击保存或者关闭模态窗口之后,想让当前的光标停留在打开模态
窗口的位置,但现在不知道什么原因页面就直接返回到顶部了,求懂的各位大侠给出办法!谢谢
showModalDialog  JS

解决方案 »

  1.   

    你打开的代码怎么写的?链接?你可以
    <input type=button onclick="window.showModalDialog('')
      

  2.   

    是这样来写:
    <a style="cursor:pointer" href="#" onclick="selectWork(this)">↓</a>
    //选择工作项
    function selectWork(thisObj){
    var style = "dialogWidth:700px; dialogHeight:500x; status:0;scroll:1; help:0; resizable:1";
    var indexs=thisObj.parentNode.parentNode.rowIndex-1;  
    var fdActId=GetEl("fdActivityListForms["+indexs+"].fdId").value;  
        var url="<c:url value='/pm/base/pm_base_activity/pmBaseActivity.do?method=editWorkDialog&fdPhaseId=${pmBasePhaseconfigForm.fdId}&fdActId=' />"+fdActId+"&fdIndexs="+indexs;  
    var rtnVal = window.showModalDialog(Com_Parameter.ContextPath+"resource/jsp/frame.jsp?url="+encodeURIComponent(url),phaseActivities[fdActId],style);    
    if(rtnVal==null)return; 
    phaseActivities[fdActId].work = rtnVal;
    var tabObj = GetID("project_test");
    work_setWorkHtml(tabObj, fdActId);
    }
      

  3.   

    改这样试下
    <a style="cursor:pointer" href="javascript:void(0);" onclick="selectWork(this)">↓</a>
      

  4.   

    不好意思 刚测试验证通过了  改成href="javascript:void(0);是可以的 谢谢!
    可以解释下是什么原因吗