As window.showmodaldialog
is depreciated in chrome, So I am using window.open() instead. But the problem is that after opening Child window I want my parent window to be disabled and if I click on Parent window it should focus on child window.
I tried with some body attributes like onmouseover
, onclick
events it is working to some extent but if there is any button on parent and if I click its respective event is getting invoked.
For now I am disabling the parent window events as below when I am opening Child window.
$('body').css({ 'opacity': 0.3, 'pointer-events': 'none' })
and after closing child window to resume
$('body').css({ 'opacity': 1, 'pointer-events': 'auto' });
Now my question is when I click on Parent window, how can I focus on child?