Connecting Tech Pros Worldwide Forums | Help | Site Map

hiding window.open

akg akg is offline
Newbie
 
Join Date: Jan 2007
Location: edison, nj
Posts: 19
#1: Jan 24 '07
Hi friends,
I am opening a popup window with window.open method. I want to hide it, someting like visible=false. is there some property or method available which solve this purpose.

Thanks,
Amit

Needs Regular Fix
 
Join Date: Jun 2006
Posts: 424
#2: Jan 24 '07

re: hiding window.open


You cannot open a new window with javascript that is hidden, positioned off screen, or smaller than a minimum size.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#3: Jan 24 '07

re: hiding window.open


Quote:

Originally Posted by akg

Hi friends,
I am opening a popup window with window.open method. I want to hide it, someting like visible=false. is there some property or method available which solve this purpose.

Thanks,
Amit

Why do you want to hide the window? Can you not just close it and open it again?
akg akg is offline
Newbie
 
Join Date: Jan 2007
Location: edison, nj
Posts: 19
#4: Jan 24 '07

re: hiding window.open


I am opening a url (asp.net page) from window.open which I am resizing if the loaded url document is bigger or smaller than the opened window, but my user didn't liked this resizing of the window. so, I thought if i could open the window with hide attribute set initially and after resizing if I could display it then users will not see the resizing effect.

any suggestions ?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#5: Jan 24 '07

re: hiding window.open


You don't need to resize the window, you can open the window the correct size in the first place.
Expand|Select|Wrap|Line Numbers
  1. window.open('yourpage.asp','','width=200,height=100')
  2.  
See this page for more info.
akg akg is offline
Newbie
 
Join Date: Jan 2007
Location: edison, nj
Posts: 19
#6: Jan 25 '07

re: hiding window.open


problem is my asp.net page will be of varying width and height and before calling in window.open method I can't get its full height and width.

Amit
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#7: Jan 25 '07

re: hiding window.open


Then how will you get the height and width after calling the page?
Familiar Sight
 
Join Date: Dec 2006
Posts: 157
#8: Jan 25 '07

re: hiding window.open


Quote:

Originally Posted by akg

problem is my asp.net page will be of varying width and height and before calling in window.open method I can't get its full height and width.

Amit

Well even if you donot know the height and width in advance still you can specify a certain height and width and keep scrollbars, will that help?
[HTML]window.open(url,"mywindow","location=1,status=1,sc rollbars=1,width=500,height=300");[/HTML]
akg akg is offline
Newbie
 
Join Date: Jan 2007
Location: edison, nj
Posts: 19
#9: Jan 25 '07

re: hiding window.open


Quote:

Originally Posted by acoder

Then how will you get the height and width after calling the page?

document.getElementById(id).offsetWidth
akg akg is offline
Newbie
 
Join Date: Jan 2007
Location: edison, nj
Posts: 19
#10: Jan 25 '07

re: hiding window.open


Quote:

Originally Posted by abctech

Well even if you donot know the height and width in advance still you can specify a certain height and width and keep scrollbars, will that help?
[HTML]window.open(url,"mywindow","location=1,status=1,sc rollbars=1,width=500,height=300");[/HTML]


no abctech, I don't have to show scrollbar to the users.
Reply