Welcome to WebmasterWorld Guest from 107.20.104.110

Forum Moderators: incrediBILL

Message Too Old, No Replies

Best way to create a User Selected, Sized Pop-Up Window

That isn't blocked by IE SP2 or Firefox

     
11:50 pm on Jan 4, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 27, 2004
posts:34
votes: 0


What is the best way to create a sized, popup window when a user clicks on a link, that isnít blocked by IE SP2 or Firefox?

My current code (done in Dreamweaver MX 2004) worked fine until IE SP2, & recently Firefox begun blocking my window as well. The problem seems to be with the javascript that defines the size of the new window (which holds an example reel video clip). Target=_blank works fine by itself, but I would prefer to have a sized window as most of the video clips are fairly small.

Is their a way that I can make a sized, new window open when a user clicks a link that is friendly to the pop-up blockers?

Thanks for your help

12:18 am on Jan 5, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 18, 2003
posts:924
votes: 0


User Selected, Sized Pop-Up Window

Isn't this an oxymoron? Why would a user who's blocking pop-up windows select one? There is so much abuse of pop-ups people have their browsers set to prevent you from doing this. They could set them to allow it, but that would make surfing miserable. Forcing your visitors do something they don't want isn't a good way to make friends.

12:26 am on Jan 5, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 27, 2004
posts:34
votes: 0


The reason I'm doing this is that it is a page (mostly info based) that has related video examples. Those video examples are small in size & don't justify the need for a complete page window, nor do I want to have the user leave the main page for this video page.
1:03 am on Jan 5, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 2, 2004
posts:551
votes: 0


I would say use target="_blank". It opens a window the same size as the last one they closed, which is usually the size they prefer. While it is not a defined size, it is 90% of the time the size the user wants, and it is hard to get closer than that.
1:10 am on Jan 5, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 24, 2002
posts:894
votes: 0


If your video is important to the content of your page I would include a little 'friendly warning' about the pop up. If then your visitor is really interested they will turn on pop-ups for this visit.

For instance, Mozilla Firefox let's you turn pop-ups on or off 'per site' and not 'all or nothing'.

Just a thought.

1:43 am on Jan 5, 2005 (gmt 0)

New User

10+ Year Member

joined:Mar 27, 2004
posts:34
votes: 0


Posting a note to turn off pop-up blockers would work, but probably be a last resort I think. (I'd rather go to a new page)

Since it's a user initiated window I hoped there was an easy way to open a small window.

I know I could do it having them link to a new page, but I would then probably have to develop page content for that video. (The content is already on the main page with the option to select which quality video you want to watch, which opens the pop-up window.)

target="_blank" works, but some of the video clips are small & look funny on such a large blank page.

I know SP2 allows for new pop-up windows if they are user initiated, so I figure their must be a way to it, just don't know what that is yet.

3:08 am on Jan 5, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


I know SP2 allows for new pop-up windows if they are user initiated . . .

This was my understanding too: pop-up blockers generally only block pop-up windows from an onload or onunload event (?) Don't they? So a new window with Javascript from a link shouldn't be blocked?

3:41 am on Jan 5, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


I use a lot of informational pop-ups, but I code them so that they will open in the same window if javascript for new windows is turned off. This also creates a click trail that spiders will follow.

First, define your popup() function in the head or an external js file. Then:

<a href="page.html" onclick="popup('page.html');return false;")>link text</a>

If javascript is working to open a new window, then the return false; code will make sure that the original page does not alo reload. If javascript isn't working for new windows, then the new resource opens in the smae window.

I stopped using target="_blank" because it is not valid in strict [x]html - but you could also add that attribute if you are writing transitional mark-up.