Jump to content

Maximising a new window

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Maximising a new window Rate Topic: -----

#1 User is offline   Chris 

  • W.R. Corporal
  • Group: Members
  • Posts: 106
  • Joined: 01-August 06
  • Location:Southampton
  • Interests:Sailing, PCs, Computer games, Tennis, Table Tennis

Posted 01 August 2006 - 05:13 AM

Im making a gallery on a website, and I want the pics to open in a new maximised window. This is what I've got for each link so far:

<a href="pic1.html" target="_blank">
<img src="building1.JPG" width="125" height="125" border="0"></a>

How do I make it so the window is maximised on opening?
"It is a mistake to think that you can solve any major problem with just potatoes." Chris
0

#2 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 01 August 2006 - 05:30 AM

There's no way to force a maximised window across the board because that power should really be in the hands of your visitors. It is possible using Javascript under some browsers, but it won't work on a lot of alternative Operating Systems or browsers.

To be honest, you should be able to trust that your visitors are savvy enough to want to maximise the window themselves if they need to. 99.99% of people know how to do this and many people will be confused or annoyed if you try to 'take control' and do it for them.

However, if you're sure you want to give it a go, then try the following code:
<script language="JavaScript"><!--
function maximiseWindow(winRef) {
  if (window.screen) {
	winRef.moveTo(0,0);
	winRef.outerHeight = screen.availHeight;
	winRef.outerWidth = screen.availWidth;
  }
}

function alterWindow(winRef) {
  maximiseWindow(winRef);
  winRef.focus();
}

var windowHandle = window.open('a.html','winname');

setTimeout('alterWindow(windowHandle)', 1);
//--></script>


That Javascript code will open a new window, load a.html into it and maximise it. You could turn it into a function quite easily.

However bear in mind that this method will probably be detected and blocked by many popup blockers. I think it would be safer simply to trust your visitors to maximise the window themselves, or simply keep the pictures you open in the same window.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#3 User is offline   Chris 

  • W.R. Corporal
  • Group: Members
  • Posts: 106
  • Joined: 01-August 06
  • Location:Southampton
  • Interests:Sailing, PCs, Computer games, Tennis, Table Tennis

Posted 01 August 2006 - 05:34 AM

Ok, thanks. I just thought it would be a bit annoying having to maximise it every time, but then again I suppose they aren't going to be clicking on pics as much as I am when testing them :)
"It is a mistake to think that you can solve any major problem with just potatoes." Chris
0

#4 User is offline   BigMike Sidelka 

  • W.R. Sergeant
  • Group: Members
  • Posts: 241
  • Joined: 31-July 06
  • Gender:Male
  • Location:C-Town, Ohio

Posted 01 August 2006 - 04:23 PM

Also heres a script that allows you to control the size of the window.

<a href="java script:void(0)" onclick="window.open('link','linkname','height=xx,width=xx,scrollbars,location,menubar,resizable,toolbar')">link</a>

scrollbars,location,menubar,resizable,toolbar are optional

I never tried it, but you can do this
width=100% height=100%
0

#5 User is offline   TJSingleton 

  • Allegedly Legendary
  • Group: Members
  • Posts: 517
  • Joined: 31-July 06
  • Location:Winder, GA

Posted 01 August 2006 - 08:48 PM

It's not generally good practice to use a java script: link. If I don't have javascript on, I won't see anything. Have you considered using a lightbox?

http://www.huddletog...ects/lightbox2/
0

#6 User is offline   benbacardi 

  • Administrator
  • Group: Administrators
  • Posts: 1,140
  • Joined: 06-April 06
  • Gender:Male
  • Location:United Kingdom

Posted 02 August 2006 - 02:14 AM

I showed Chris lightbox on msn the other day, actually... he said he was too lazy to go and change it ;)
0

#7 User is offline   Chris 

  • W.R. Corporal
  • Group: Members
  • Posts: 106
  • Joined: 01-August 06
  • Location:Southampton
  • Interests:Sailing, PCs, Computer games, Tennis, Table Tennis

Posted 02 August 2006 - 05:26 AM

Yep I did :unsure: Might get round to it at some point.
"It is a mistake to think that you can solve any major problem with just potatoes." Chris
0

#8 User is offline   James Mitchell 

  • Legendary
  • Group: Administrators
  • Posts: 922
  • Joined: 26-July 06
  • Gender:Male
  • Location:Fort Wayne, IN

Posted 02 August 2006 - 07:39 AM

There are other alternatives than lightbox, that act similar.

I blogged about them here in April

Sidenote: we don't know the meaning of the word lazy as designers do we.
Posted Image
0

#9 User is offline   TJSingleton 

  • Allegedly Legendary
  • Group: Members
  • Posts: 517
  • Joined: 31-July 06
  • Location:Winder, GA

Posted 02 August 2006 - 08:39 AM

However you do it, make it unobtrusive.
0

#10 User is offline   James Mitchell 

  • Legendary
  • Group: Administrators
  • Posts: 922
  • Joined: 26-July 06
  • Gender:Male
  • Location:Fort Wayne, IN

Posted 02 August 2006 - 08:56 AM

View PostTJSingleton, on Aug 2 2006, 09:39 AM, said:

However you do it, make it unobtrusive.

Exactly, If you don't make it unobtrusive it'll ultimately distract from the site and thats not what you want. Good point TJ.
Posted Image
0

#11 User is offline   moojoo 

  • Argh!
  • Group: Members
  • Posts: 449
  • Joined: 03-August 06
  • Location:Texas

Posted 03 August 2006 - 03:19 PM

I tend to not revisit sites that resize my windows but thats me. Something to consider.
Its not girly, its web 2.0!
0

#12 User is offline   Ben Abrams 

  • The buddy system:never fails
  • Group: Administrators
  • Posts: 1,850
  • Joined: 04-April 06
  • Gender:Male

Posted 03 August 2006 - 05:17 PM

its not somthing a site should be trying to control

View PostSirkent, on 21 September 2007 - 04:26 AM, said:

<monty python high-pitched female voice>I DON'T LIKE SPAM!</monty python high-pitched female voice>
0

#13 User is offline   James Mitchell 

  • Legendary
  • Group: Administrators
  • Posts: 922
  • Joined: 26-July 06
  • Gender:Male
  • Location:Fort Wayne, IN

Posted 03 August 2006 - 06:37 PM

View Postbenbramz, on Aug 3 2006, 06:17 PM, said:

its not somthing a site should be trying to control

True, with the exception of the full screen lightbox type as those are click-activated.
Posted Image
0

#14 User is offline   magazineforall 

  • W.R. Private
  • Group: Members
  • Posts: 43
  • Joined: 01-August 06
  • Location:York, England, UK

Posted 15 August 2006 - 11:56 AM

Well it just goes to show how we're all different.



For me personally if a picture is bigger than the browser window. I personally would have it automatically resize. Especially if I wanted to view lots of photos in the gallery.



Have you thought about using something like Gallery? (http://gallery.sf.net)



Good luck with it anyway :)
0

#15 User is offline   moojoo 

  • Argh!
  • Group: Members
  • Posts: 449
  • Joined: 03-August 06
  • Location:Texas

Posted 16 August 2006 - 08:14 AM

Most modern browsers scale images to fit. In this case though I think a lightbox would be the way to go. Resizing peoples windows etc is just mean.
Its not girly, its web 2.0!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users