开发者

Is it possible to add a class when popup is open?

Is it possible to add a class when a 开发者_运维技巧popup is open using window.open with javascript or jquery?


With jQuery you can access the opened window's properties.

var newWind = window.open('http://<url_here>', 'childWindow')

$j(newWind.document).find('html').addClass('opened-as-popup')


Another solution:

var WindowObject = window.open('');
WindowObject.document.write('<body class="newClass">');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜