onload help

  • ReLapse
  • Born
  • Born
  • No Avatar
  • Joined: Sep 11, 2003
  • Posts: 2
  • Status: Offline

Post September 11th, 2003, 9:49 pm

I have a website that currently has a ENTER page. I want to change that so when you click a link to my site it onloads the mainpage to a certain size.

Also at the same time in this new window i want to disable toolbar, menubar, scrollbars, resize, location, directories and status.

Can anyone help me? I would do it myself if i knew how but our webmaster has left and refuses to help us. I don't know anyone who knows this stuff.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post September 11th, 2003, 9:49 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post September 12th, 2003, 6:45 am

Try this as a possibility:

Code: [ Select ]
<script type="javascript">
function popupmain(url, width, height, left, top, menuBar, scrollbars) {
var popupmain = window.open(url,"popupmain",'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',menuBar=' + menuBar + ',scrollbars=' + scrollbars + ',resizable=0' + ',toolBar=0'); 
popupmain.focus(); }
</script>
  1. <script type="javascript">
  2. function popupmain(url, width, height, left, top, menuBar, scrollbars) {
  3. var popupmain = window.open(url,"popupmain",'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',menuBar=' + menuBar + ',scrollbars=' + scrollbars + ',resizable=0' + ',toolBar=0'); 
  4. popupmain.focus(); }
  5. </script>


Then for your link:
Code: [ Select ]
<a onClick="this.blur()" href="javascript:popupmain('yourpage.html',%20450,%20450,%2050,%2050,%200,%2011)">
My Main Page</a>
  1. <a onClick="this.blur()" href="javascript:popupmain('yourpage.html',%20450,%20450,%2050,%2050,%200,%2011)">
  2. My Main Page</a>


This is the part you will have to adjust:
Code: [ Select ]
%20450,%20450,%2050,%2050,%200,%2011

They represent the values for width, height, left, top, menuBar, and scrollbars respectively. So in this case width is 450 px and height is 450 px. This will be the width and height of the window. If you wanted it to be 600x600 you would change the first 2 %20450's to %20600.
The next two %2050's are the position the window will appear when it opens - in this case 50 pixels from the top and left of the screen. You may need to adjust this to center it where you want it. The %200 - is the menu bar. The zero at the end shuts off the menu - if you wanted it on you would use %201. The last number is the scrollbars. Both the ones at the end indicate both horizontal and vertical scrolling are on. To turn both off use %2000

The resizable part and toolbar part are handled in the script. Both are set to 0 which turns them off. If you wanted them on set them to 1. (I wasn't 100% sure about the toolbar, but I think that's it).

I did that pretty quick. I don't think there are any errors in it. My apologies if there are.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 123 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.