/    Sign up×
Community /Pin to ProfileBookmark

desperate popup problem

Hello everybody,

i am a ‘fairly’ good flash programmer and i have this site that i would like to display in a popup window. It’s no spam at all , just a popup that opens if the user clicks on a ‘enter site’ link. The popup contains my flash website.
I have searched for hours on google and browsed through different fora, but i still didn’t find the solution ?

This is what i got so :

I managed to make it work completely as i want, but only on Firefox.
To do that i put this piece of Javascript in my index.html file :

in the head of the html file
[script]
var scrH = screen.height;
var popLeft = (screen.width-1000)/2;
var popTop = (screen.height-800-60)/2;

function openMainPopup(loc,name,w,h)
{
window.open(loc,name,”toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=”+w+”,height=”+h+”,top=”+popTop+”,left=”+popLeft);
}
[/script]

and called the function like this
[script]
openMainPopup(“http://www.mysite.com/index.html“, “my site”, 1000,800);
[script]

this way, it worked for Firefox, but not on IE (‘a popup has been blocked’ apeared.

then i tried it like this :

[code=html]
<map name=”Map”>
<area shape=”rect” coords=”1,0,400,400″ href=”thankyou.html” onclick=”openMainPopup(‘mysite.html’, ‘mysite’, 1000, 800)”>
</map>
[/code]

so that the function would not be called automatically, but on a click from the user.
This also worked on Firefox, but on IE it was even stranger then before :
now nothing at all happened! Not even an ‘a popup has been blocked’ message…..

Does anybody know a way around this???
I really need a popup for my site, and i know it can be done.
For example : [url]http://www.workstation-uk.com/[/url]

Thanks very very much!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@hyperliskNov 22.2006 — I've had the same problem before. It's because IE sucks and doesn't like you to set a variable to the screen.width/height for some reason. I overcame this by just passing that the the window.open

Example:
<i>
</i>
window.open(loc,name,"toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=no,width="+w+",height="+h+",top="+((screen.height-800-60)/2)+",left="+((screen.width-1000)/2));

Copy linkTweet thisAlerts:
@m_i_c_authorNov 25.2006 — Thanks hyperlisk, i tried it your way and it works :d
×

Success!

Help @m_i_c_ spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...