I have opened a poup up window with a specific width,height ,top,left.
var newwindow=window.open("one.html",'name','height=200,width=650,top=300,left=100');
After 5 seconds i need to change the width,height,top,left of the popup window from a setInterval function in the main page. how can i do that.?
This code must be in child window
function calledOnBodyLoad(){
setTimeout(resize_now, 6000);
}
function resize_now(){
window.moveTo(new_posx,new_posxy);
window.resizeTo(newSizeX, newSizeY);
}
If you want to control the pop up window from the parent window then use the following (in parent window)
////
var newwindow=window.open("one.html",'name','height=200,width=650,top=300,left=100');
setTimeout(resize_now, 6000);
///
function resize_now(){
newwindow.moveTo(new_posx,new_posxy);
newwindow.resizeTo(newSizeX, newSizeY);
}
Remember in this case newwindow must be a global variable or pass it as a arguement to the resize_now function.
Demo here
Inside the OnLoad function of one.html, add a timer function that will get executed after five seconds. Make the necessary changes in that function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With