2010-12-02 46 views
5

我使用SimpleModal,我(使用FF) 似乎工作確定在IE9,但在FF它被調用IFRAME SRC兩次時,打開的iframe它調用兩次

打開的iframe的SRC

感謝您的幫助

代碼我打電話的樣子

function addNew(){ 
    var src = "/php/ftp/parsehome.php?dir="+userDir+"&idx=new"; 
    $.modal('<iframe src="' + src + '" height="445" width="800" style="border:0">', { 
      containerCss:{ 
       backgroundColor:"#E1EFF7", 
       borderColor:"#00A99D", 
       height:450, 
       padding:0, 
       width:840 
       }, 
       modal: true 
      }); 
} 
+0

你能通過兩次調用幀src來解釋你的意思嗎? – 2010-12-07 18:19:03

回答

2

我遇到了同樣的問題。縱觀插件代碼...

// add styling and attributes to the data 
// append to body to get correct dimensions, then move to wrap 
s.d.data = data 
    .attr('id', data.attr('id') || s.o.dataId) 
    .addClass('simplemodal-data') 
    .css($.extend(s.o.dataCss, { 
     display: 'none' 
    })) 
    .appendTo('body'); 
data = null; 

你可以看到data被添加到頁面主體與線.appendTo('body');來計算模式的正確的尺寸。如果你註釋掉這一行,它會阻止iframe被調用兩次。

// add styling and attributes to the data 
// append to body to get correct dimensions, then move to wrap 
s.d.data = data 
    .attr('id', data.attr('id') || s.o.dataId) 
    .addClass('simplemodal-data') 
    .css($.extend(s.o.dataCss, { 
     display: 'none' 
    })); 
data = null; 

不知道這個修改將導致您的模態大小有錯誤的尺寸,但我的iframe設置爲width=100%height=100%所以沒有影響到我。

相關問題