Reply to Re: target _blank and opening a new window in Firefox

Your name:

Reply:


Posted by Andrew Bailey on 11/26/07 09:00

"Ubi" <ubimmc93@libero.it> wrote in message news:ficici$h3b$1@aioe.org...
> Is there some way to force firefox to open a new page in a new window and
> not in a new tab of the same window?
>
> I have a small popup with an audio player and links for infos about the
> songs.
> Those links have target _blank, but in Firefox (instead of opening the
> info pages in a new window) it opens the pages in a new tab in the same
> popup window, which is very unusable.
>
>
> Daniele
>

Hi Daniele,

Put this javascript in the <head> of your document...

<!-- * Script from HTMLHelpCentral.com - visit for tutorials, scripts,
helpful forums and more! * -->
<script type="text/JavaScript" language="javascript">
<!-- www.htmlhelpcentral.com
function winBRopen(theURL, Name, popW, popH, scroll) { // V 1.0
var winleft = (screen.width - popW) / 2;
var winUp = (screen.height - popH) / 2;
winProp =
'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+','
Win = window.open(theURL, Name, winProp)
if (parseInt(navigator.appVersion) >= 4){
Win.window.focus();
}
}
-->
</script>

If you want the user to be able to resize the popup window then substitute
the appropriate line with...

winProp =
'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable'

Then in the <body> use this line as a template for a link...

<a href="somepage.html"
onClick="winBRopen('somepage.html','TITLE','320','256','yes');return false;"
title="Click here to open window">CLICK</a>

TITLE = The title of the popup window if none is specified in the popup
document.
320 = width of popup.
256 = height of popup.
yes = do you want scrollbars? (yes, no, auto).

Hope this helps


Andy

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация