• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

javascript: can remove the toolbars from the main browser window??

Hi

I want to remove the toolbars from the main browser window. Is That possible?

If that is possible, please provide the code. ( I will add an extra 250 points to whoever supplies the correct code)


Thanks!!!
0
vanauden
Asked:
vanauden
  • 12
  • 4
1 Solution
 
archrajanCommented:
<script language="JavaScript"><!--
if (history.length != 1) {
    window.open(location.href,'main','fullscreen=yes,outerHeight=' + screen.availHeight + ',outerWidth=' + screen.availWidth);
    setTimeout('self.close()',1000); // close self after a seconds delay
}
0
 
archrajanCommented:
if(document.location.search=='')  {
 newwin=window.open(document.location + "?newwin=true", name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
 self.close()
}
0
 
archrajanCommented:
with style you can hide scroll bars just add in the body <body style="overflow:hidden;">
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
vanaudenAuthor Commented:
I will get back to this in about 4 hours after checking the code and doing some other stuff like feeding myself. ;-)   Thanks!
0
 
archrajanCommented:
specify the height and width and other properties i my second comment and call it on body onload
var height = 600                    
var width = 600            
var name = "nameofthewindow"            
var top = 20
var left = 20                            
0
 
archrajanCommented:
0
 
vanaudenAuthor Commented:
Hi archrajan

Is it possible to maximise the window in this script, instead of specifying a size??

0
 
archrajanCommented:
yeah it is...possible
0
 
archrajanCommented:
<script language="JavaScript"><!--
if (window.screen) {
    window.moveTo(0,0);
    window.outerHeight = screen.availHeight;
    window.outerWidth = screen.availWidth;
}
//--></script>
0
 
vanaudenAuthor Commented:
Thank you, but I do not know javascript very well, could you integrate that into your current code as below, I have again increased the points... to 500:

<script language="JavaScript">
function newpage() {
      if(document.location.search=='')  {
            var height = 700                  
            var width = 1013          
            var name = "nameofthewindow"            
            var top = 0
            var left = 0    
             newwin=window.open(document.location + "?newwin=true", name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
             self.close()
}
</script>
0
 
archrajanCommented:
script language="JavaScript">
function newpage() {
     if(document.location.search=='')  {
          var height = 700                  
          var width = 1013          
          var name = "nameofthewindow"            
          var top = 0
          var left = 0    
           newwin=window.open(document.location + "?newwin=true", name, "fullscreen=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
           self.close()
}
</script>


try this..
0
 
archrajanCommented:
and u need not specify the width and height then
0
 
archrajanCommented:
see this for reference
The Javascript open function does not support opening new windows maximized, but it does support opening opening windows at a certain size. The problem being that Netscape and Internet Explorer do this differently and not all versions of all the browsers support the sizing on the open command so we need to double up and resize the window again once its opened.
This function accepts a URL to display in the window and the logical name of the window, if a window with that logical name is already open it will be brought to the front. The function returns the handle to the window.

function f_open_window_max( aURL, aWinName )
{
   var wOpen;
   var sOptions;

   sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
   sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
   sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

   wOpen = window.open( '', aWinName, sOptions );
   wOpen.location = aURL;
   wOpen.focus();
   wOpen.moveTo( 0, 0 );
   wOpen.resizeTo( screen.availWidth, screen.availHeight );
   return wOpen;
}
0
 
archrajanCommented:
let me know if u need something else.. i can help u with
0
 
vanaudenAuthor Commented:
Hi archrajan

Thank you very much for your patience and help!

This is exactly what I need!!!

Have a great day!

Ian
0
 
archrajanCommented:
Glad that i could help
Thanks for the grade and points
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 12
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now