Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
273 views
in Technique[技术] by (71.8m points)

javascript - Need wisdom! Open a child window in new tab, when child closed clicking links do nothing. Worked before opening child

By clicking in an image ( onClick ), I am able to popup a new Child window in Parent tab and either click in the Child window or the viewable area in the Parent and close Child window. Links that worked in the Parent before do not work after opening/closing Child window. Funny thing is that I an open another Child window as above which works.

See for yourself here.

Used javascript on parent:

let win = "";
function showBig(Path,sWw,sWh,nWw,nWh)  {
 var popIt = document.getElementById('Mask').className;
 if (popIt == 'Active' )    {
    document.getElementById('Mask').className = 'Popup';
  var l=((sWw - nWw)/2)
  var t=((sWh - nWh)/2)
  win = window.open('ShowBig.php?'+Path+','+nWw+','+nWh, '_blank','left='+l+',top='+t+',width='+nWw+',height='+nWh+',resizeable=0')
    let bar = document.querySelector("body");
    setTimeout(() => {  bar.addEventListener("click", event => { closeChild(); event.preventDefault();  }, true) }, 500 );
 }
}
function closeChild()       {
    document.querySelector('body').removeEventListener("click",closeChild, true)
    document.getElementById('Mask').className='Active';
    win.close()
}
    
function closeBig(id,Path,I)        {
 document.querySelector('body').removeEventListener("click",closeChild, true)
 document.getElementById('Mask').className='Active'
 window.close()
}
question from:https://stackoverflow.com/questions/65906430/need-wisdom-open-a-child-window-in-new-tab-when-child-closed-clicking-links-do

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...