window.showModalDialog("ChangeXingSha.aspx?fangxiang=l&x=" + (x - img.getBoundingClientRect().left) + "&y=" + y, window, "xxx", "dialogWidth:510px;dialogHeight:345px;scroll:no;status:no;dialogLeft=" + x + ";dialogTop=" + y + ";");
上面是打开模式窗口的代码,在参数中加了window以后,后面的就长宽就失效了,怎么回事?

解决方案 »

  1.   


    参数传递不对,window.showModelessDialog('filename.htm',window,'dialogWidth=200px;dialogHeight=250px;') 
    &直接用&看看
    参考:http://hi.baidu.com/kingdom031/blog/item/5a3b9bdf24878515632798ed.html
    http://cai555.javaeye.com/blog/621246
      

  2.   

    showModalDialog的使用规范如下
    vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures]) 
    你上面的window跟的"xxx"已经是第三参数了.如果"XXX"是你想传到模式窗口的值,用个花括号括起来:
    ...,{window, "xxx"},...
    模式窗口中参数会变成数组.
      

  3.   


    [code="JScript" ]showModalDialog("test.jsp", window, "dialogWidth:350px;dialogHeight:450px;help:no;scroll:no;status:no");[/code]
      

  4.   


    是的,不用“XXX”就好了,我以为是模式窗口的标题。