By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,709 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

Change the window style using JS.

dmjpro
100+
P: 2,476
Suppose if i do window.open then the styles(features) can be set in feature parameter. If the system opens the window then how can i set the styles(features) using JS. I mean can i access the styles(features) of the current window using JS?

Please help me out!
Feb 3 '09 #1
Share this Question
Share on Google+
12 Replies


Dormilich
Expert Mod 5K+
P: 8,639
@dmjpro
if your opened window is a html file, you can use JS to pretty much changing all you want. you only need to find the right JS properties for that.
Feb 3 '09 #2

dmjpro
100+
P: 2,476
Yeah i know that ...but what are the properties ........... how can i set those properties ???
Feb 3 '09 #3

Dormilich
Expert Mod 5K+
P: 8,639
consult your favourite JS reference. e.g. window object MDC
Feb 3 '09 #4

acoder
Expert Mod 15k+
P: 16,027
Note that some properties can only be set with window.open or before a window is opened with the required privileges.
Feb 3 '09 #5

dmjpro
100+
P: 2,476
@acoder

Can't i do that after window opened?
I want to remove the status bar(in IE,because in Mozilla it does not happen) ...menu bar or something else. To set the height and width we can do it using resizeTo. So if i want to remove the menubar and addressbar ..what should i do to get that?
Feb 3 '09 #6

acoder
Expert Mod 15k+
P: 16,027
See, for example, window.menubar. You'll need privileges unless the script is signed. The rest of the *bars can be toggled similarly.
Feb 3 '09 #7

dmjpro
100+
P: 2,476
@acoder
What you told over here ...could not get you.
One more thing if want to place the window ..at a particular position then how can i do?
Feb 3 '09 #8

acoder
Expert Mod 15k+
P: 16,027
It's explained in the link, but see this link for more information.

To move the window, use window.moveTo() - linked from the link posted by Dormilich earlier. Any reason why you're messing with the current window?
Feb 3 '09 #9

dmjpro
100+
P: 2,476
Ahh ....aaa ....moveTo i couldn't remember ... ;)
Actually i making it as full screen .... actually our window containing a lot of things .. so it would be better if i get some spaces ...
Actually firstly main window opened as new window(there all the features i could set) .. now .... no new window is opening ..that's why i wanting to the first window (opened by system) be as full screen ...
By the way .. if it is taking a lot of effort then it would be better to redesign a little bit of the main window ... ;)
Actually whenever the security comes in then it should not be doing that ... if no other options is there.
Feb 3 '09 #10

acoder
Expert Mod 15k+
P: 16,027
I assume this is for an internal application. You can use screen.height/width to make it full screen.
Feb 3 '09 #11

dmjpro
100+
P: 2,476
Actually what i did, just called resizeTo(screen.width,screen.height) and moveTo(0,0). I think more than this nothing we can do. As per bar toggling concern i think there is another hurdle(change security policy) to do. Common user can't do that. We are serving the page to common user.
Anyway i managed my main screen to work. Thanks for your help Acoder!
Feb 4 '09 #12

acoder
Expert Mod 15k+
P: 16,027
By common user, do you mean on the internet (outside your company intranet) for any user to access? If that's the case, I would avoid resizing the browser. Some tech-savvy users will have changed their settings to make sure your script can't change the size of the browser.
Feb 4 '09 #13

Post your reply

Sign in to post your reply or Sign up for a free account.