jqWidget의 jqxWindow의 'isOpen' API
Returns true when jqxWindow is opened and false when the jqxWindow is closed
Parameter Type Description
None
Return Value
Boolean
Code example
Invoke the isOpen method.
$('#jqxWindow').jqxWindow('isOpen');
코드
$(window).scroll(function() {
var bOpen = $('#jqxWindow').jqxWindow('isOpen');
var winHeight = $(window).height();
var winWidth = $(window).width();
// window 팝업이 열려있지 않을 때만 스크롤에 따라 position 변경해주기 위해서
if(!bOpen) {
var posX = (winWidth / 2) - ($('#jqxWindow').width() / 2) + $(window).scrollLeft();
var posY = (winHeight / 2) - ($('#jqxWindow').height() / 2) + $(window).scrollTop();
$('#jqxWindow').jqxWindow({
position: { x: posX, y: posY }
});
}
});