2011-09-06 80 views
0

我正在使用jquery windows engine plugin。我創建窗口如下:獲取窗口的ID

for(i=1;i<=3;i++) 
    { 
    mywidth=i-1; 
    mywidth = mywidth*newWidth; 
    $.newWindow({ 
     id:"iframewindow"+i, 
     posx:11+mywidth, 
     posy:38, 
     width:newWidth, 
     height:maxHeight, 
     title:"Window:"+i, 
     type:"iframe", 
     onWindowClose:function(){ 
        alert(id) 
       } 
       minimizeButton: true, 
         maximizeButton: true, 
         closeButton: true, 
         draggable: true, 
         resizeable: true 
    }); 
    } 

如何獲取onclose事件中特定窗口的ID。

回答

0

嘗試

onWindowClose:function(){ 
    var id = $(this).attr('id'); 
    alert(id); 
} 
0

我不知道這個插件,但野生的猜測是$(this).id的onWindowClose處理程序中。