Tech Support Guy banner
Status
Not open for further replies.

HTML Window Size

1K views 3 replies 3 participants last post by  SabreWolf3  
#1 ·
Hi All

Apologies if this is in the wrong forum but here's a simple question for you. I am using MS FP for XP. I know how to create a hyperlink from an image or text or whatever, but what I don't know how to do is to make the sixe of that new window specific. It's NOT for those annoying pop-up advertisement screens, it's to enable me to present information on club members i.e. pictures and news stories for a site I am doing for a mate - http://gassor.co.uk

I don't like the look and feel of one or two pages and want to make things a little better. Can someone please advise how I dop this. Ta.

John
 
#4 ·
Hi John,

The proper command for opening a new window is this:

window.open('www.microsoft.com ','windowname','width=320,height=240')

This command will open www.microsoft.com in a window named "windowname" at a width of 320 pixels and a height of 240 pixels. This is your basic window open command, and all of the parameters in bold are what you need to customize for your needs.

You can also specify if the window will have a toolbar, a location bar, directory buttons, a status bar, a menubar, scrollbars and whether or not you want the new window to be resizable.

A full window command would look like this:
window.open('http://www.microsoft.com','windowname','width=320,height=240,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no')

Now, to invoke this method of opening a new window, you need an action. You can do this in several ways: a text hyperlink, an image, a javascript button, or an onLoad event, and many, many more. I'll give basic examples below.

Believe it or not, the trickiest part of implementing these is knowing where to send your link tag. The easiest way to do it is to create an anchor somewhere on your page, and have the link point to that anchor. So do the following.

Somewhere at the top of your page, after the [body] tag, put this:

(instead of html opening and closing tags, which are the less than and greater than symbols, I am using brackets [] so that my code will show up here. Be sure to change the brackets to their appropriate html tag characters)

[a name="top"][/a] That places an anchor named TOP on your page.

So, now your hyperlink to open the new window will look like this.
[a href="#top" onClick="window.open('[B]http://www.microsoft. com[/B]','[B]windowname[/B]','[B]width=320,height=240,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no[/B]')"]The user will click on this text.[/a]

For an image, it's almost the same as always... you just add in the window.open command with the anchor too.

[a href="#top" onClick="window.open('[B]http://www.microsoft. com[/B]','[B]windowname[/B]','[B]width=320,height=240,toolbar=yes,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no[/B]')"][img src="button.gif"][/a]

Got it? Good luck, and post back if you need more help!

Richard
 
Save
Status
Not open for further replies.
You have insufficient privileges to reply here.