Making button to open website in new window?

J

JFWL

I have few buttons in my website which contains link to another website. How
I can make them open in new window? Couldn´t find any direct choise like
"open link in new window".
 
M

MAURH

JFWL,

You don't say which version of Publisher you are using but this works for
2003 and 2007. It may work for other versions but I use 2003.

Place this code into the >Insert>HTML Code fragment box, you can copy and
paste it from here:

<script language="JavaScript" type="text/javascript">function Show(Url,
Name, Features) { window.open(Url, Name, Features); }</script>

The box that appears on your web page can be placed anywhere on the white
page and can be made as small as you like, just make sure that it doesn't
overlap any other element.

Then highlight the linked picture or text and into the >insert hyperlink>
box, insert this code, again you can copy and paste from here:

javascript:Show('http://*****','newwindow','')

Replace the ***** with the URL of the website you wish to link to. I usually
create and save this link in notepad, insert the URL and then copy and paste
into the hyperlink box, that way you don't miss anything out.
If you want to change the size of the window, string this code to the new
window code:

toolbar=no,scrollbars=yes,resizable=yes,height=600,width=700

You can adjust the size of the window by just changing the height and width.

Hope this helps.

Maureen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top