Opening a Web Page in  a New, Specifically Sized Window





This method uses an image already on the server (or on the web somewhere) as the link to open another web page in a new window.  The following code is added to an HTML snippet.


<script type="text/javascript"> function open_win() { window.open("URL OF SITE/PAGE TO BE OPENED","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=650, height=740") } </script>

<input type="image"  width=80, height=92, src="URL OF IMAGE TO BE DISPLAYED" onclick="open_win()"> </body></html>


The code in red are user changeable to suit your particular design.  Thanks to quaus for the code.


The page opened is a Wufoo form which fits nicely in a small window.

The following code, when added to an HTML Snippet, will create a button to open the specified file and a new window with a user determined size. This code is for a Quicktime movie file.


<script type="text/javascript">

function open_win()

{

window.open("URL to location of linked file","_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=580, height=500") }</script>


<form><input type="button" value="Click to Play" onclick="open_win()"> </form>


The movie was placed in my server’s root folder. The link for that location would be http://oldtoad.net/Movies/File_Name.  The text in red is what the user needs to change to fit their situation.  Movies work particularly well in this situation since the open by default in a dark gray background window which makes for a nice presentation.


Thanks to Alancito for pointing me to this site, iWeb Tips and Tricks by Artotems, and the code.


This way you can upload your movies just once to your iDisk and link to them.  When you edit and republish the site/page the movies don’t have to be uploaded again.

Button to open a photo in a new window at a specified size

Button to open a text document located server in a new window.

The script for the button above is:


<script type="text/javascript">function open_win(){window.open("URL TO FILE ON SERVER","_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, titlebar=no scrollbars=no, resizable=no, copyhistory=yes, width=600, height=750") }</script><form><input type="button" value="Click to View Document in a New Window" onclick="open_win()"> </form>

Javascript for HTML Snippet to Open a Linked Item in a New Window Without a Button.


Just click on any of the items to open.

The code used is:


<script type="text/javascript">

function open_win()

{

window.open("URL OF ITEM TO BE OPENED","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=XXX, height=XXX") }

</script>


<A><img name="PopUpWin1" border=0 height=XXX width=XXX src="URL OF IMAGE DISPLAYED" onclick="open_win()"></A>


This can be used to open another image, document or page. 


Thanks to Jim Scott for the code from this Apple Discussions topic:  Pop Up Without Button.

This graphic opens a plain text document

This photo opens a QT movie

This graphic opens a poster collage of 96 photos

Open Item In a New Specified Sized Window

Javascript for HTML Snippet to Open a Linked Item in a New, Specifically Sized Window via Text Link.

The code used is:


<a href="#" onClick= "MyWindow=window.open('URL TO ITEM TO BE OPENED', 'MyWindow1', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=XXX, height=XXX, left=XX, top=XX'); return false;"> Click here to view Apple's 1984 award winning Super Bown TV ad.<br><br></a>


The items in red are user editable.


Thanks to Wyodor for the code

Button to open a movie in a new window at a specified size

Text to open a photo in a new window at a specified size

Script for the text link above is:


<SCRIPT TYPE="text/javascript">

<!--

function popup(mylink, windowname)

{

if (! window.focus)return true;

var href;

if (typeof(mylink) == 'string')

   href=mylink;

else

   href=mylink.href;

window.open(href, windowname, 'width=1125,height=750,scrollbars=no');

return false;

}

//-->

</SCRIPT>

<A

   HREF="URL TO IMAGE FILE ON SERVER","_blank"

   onClick="return popup(this, 'notes')">Click to view photo full size</A>