开发者

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

开发者 https://www.devze.com 2023-02-20 22:55 出处:网络
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.

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

精彩评论

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