|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Change window size and nav bar status on page load
Hi all,
I am newbie in js. Is it possible to change window size (eg. 640 x 480) and disable all navigation bar, button bar etc.. when the page load. I know it is easy to do that if I create button/link from other page to trigger this event. The problem is I can't edit the source page from the client. Thanks and regards |
|
#2
|
||||
|
||||
|
|
|
#3
|
|||
|
|||
|
Hi stumpy,
I tried using onload function... but it work only on Resize window. My code quote as below. Can you tell me what's wrong on navigation bar control. <html> <head> <title>Testing JavaScript Function</title> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <SCRIPT LANUAGE="JavaScript 1.2"> <!-- function RSto() {window.resizeTo(800,600)} //--> </SCRIPT> <SCRIPT LANUAGE="JavaScript 1.2"> <!-- function NBar() { window.locationbar.visible=false; window.menubar.visible=false; window.personalbar.visible=false; window.scrollbars.visible=false; window.statusbar.visible=false; window.toolbar.visible=flase; } //--> </SCRIPT> </head> <body BGCOLOR="#FFFFFF" onload="RSto();Nbar()"> </body> </html> Tks kinetic1904 |
|
#4
|
|||
|
|||
|
try using a javascript link in one page <a href="javascript:testJscript();"> link</a>
to call this function in the header.. function testJscript () { window.open("Test_Javascript_Window.html", "jstest", "height=600,width=800,channelmode=0,dependent=0,dir ectories=0,fullscreen=0,location=0,menubar=0,resiz able=0,scrollbars=0,status=0,toolbar=0"); } Last edited by meth : January 24th, 2003 at 05:16 AM. |
|
#5
|
|||
|
|||
|
Hi meth,
My problem is I can't edit the link page (my client don't allow me to add js in their existing page). My design web page is only fit in the window 640 x 480 without any navigation bar. Can you give me any directions to complete the task beside using onload function. Thanks for your help. |
|
#6
|
|||
|
|||
|
try placing something like this in the header then...
self.menubar.visible=false; self.toolbar.visible=false; self.locationbar.visible=false; self.personalbar.visible=false; self.scrollbars.visible=false; self.statusbar.visible=false; |
|
#7
|
|||
|
|||
|
Hi Meth,
It didn't work...with error (self.menubar--- is null or not a object) Anyway, thank for your help.. Now, I try another method to complete this task. I will try using onload function to open my target window, then close self.window. However, this method has one side effect, user will asking to confirm parent window. So, another question is .. Is it possible to disable "Confirm close window" button when using self.window.close() function? Thanks |
|
#8
|
|||
|
|||
|
using the self.close() method inthe new window will bypass the confirm message.
|
|
#9
|
|||
|
|||
|
Quote:
So using javascript:self.close() is better than javascript:window.close()? I just tried it & still got the confimation. Did I do something wrong? Code is below... <a href="javascript:self.close()">Close</a> |
|
#10
|
|||
|
|||
|
The word "false" was spelled wrong in your code. After fixing that I still could not get the code to work right. It gives me a java error on the body tag. <body BGCOLOR="#FFFFFF" onload="RSto();Nbar()"> Any idea what the problem could be? Thanks in advance for the help.
Quote:
|
|
#11
|
|||
|
|||
|
Quote:
You cannot close a window programatically which you have opened manually from the page itself. But you close the parent window from the child window as window.opener.close(); |
|
#12
|
|||
|
|||
|
i am also looking for same think
Please let me know if your query gets solved.
My code is <body BGCOLOR="#FFFFFF" onload="window.locationbar.visible=false;window.menubar.vi sible=false;window.personalbar.visible=false;windo w.scrollbars.visible=false;window.tatusbar.visible =false;window.toolbar.visible=flase;window.resizeT o(800,600);"> Texts </body> From zeeshan.theshakirs.com Quote:
|
|
#13
|
||||
|
||||
|
In general, I believe a webpage should not control a browser's behaviour. It is extremely confusing for the users. Correct me if I'm wrong, but a page cannot modify a browser window that is already open. You can control how a new window appears [window.open], but you can't modify the window your script is currently in.
Zeeshan, aside from the fact there's a bunch of spelling mistakes, I don't believe you can make those calls in the onload event.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#14
|
|||
|
|||
|
disable toolbar for IE
Hi
I am trying to use same code in asp.net 2.0 page which you are given below but it gives me Object expected javascript error. can you plz tell me what will be the wrong in my code.Following code which i am using. in JS file function test() { window.locationbar.visible=false; window.toolbar.visible=false; window.personalbar.visible=false; window.menubar.visible=false; } in asp.net file .master page onload I m calling this test page. I have included the above JS file in that master page file. Please help me out in this. Regards Parag. Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Change window size and nav bar status on page load |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|