/    Sign up×
Community /Pin to ProfileBookmark

‘open new window’ works on IE but not Firefox? help please :)

Hi folks, I’m a web design newby (ish – just done a lot of reading thats all) and have made a website for my art, (oil paintings a prints).

[url]www.pennylanepictures.com[/url]

My problem is this, once you get into the gallery, and you click on one of the little thumbnails, it takes you to an info page of that particular painting. Then I’ve done it so if you want to see a bigger pic, you click on the picture and it opens up a close up in a new window (so you dont lose your page, and so i can keep the format of the site intact).

This all works fine in IE… but then I started testing it in Firefox… and no matter what I did to the settings, it always did exactly the same thing. It opened up the new window… BUT… it also opened up the same image in the existing window… which was what i was trying to avoid. Not to mention it looks very unprofessional when you have the same image opened up twice.

Any ideas you lovely helpful people? ?

Thanks

to post a comment
Full-stack Developer

11 Comments(s)

Copy linkTweet thisAlerts:
@CharlesDec 01.2005 — <a href="the-big-picture.png" onclick="window.open (this.href, 'child'); return false">
<img alt="The big picture" src="thumbnail.png">
</a>
Copy linkTweet thisAlerts:
@hunky_artistauthorDec 03.2005 — ooh, that's quite different than the way i found to use which was...

[INDENT]function MM_openBrWindow(theURL,winName,features) { //v2.0

window.open(theURL,winName,features);

}[/INDENT]

in the head... plus...

[INDENT]<a href="bluelarge.htm">

<img src="paintings/bluestandardviewsmaller.jpg" alt="Click here for larger image" width="310" height="377" border="0" onMouseDown="MM_openBrWindow('bluelarge.htm','Blue','width=494,height=600')"></a>[/INDENT]

in the main page.

This works fine on IE but for some reason on Firefox it opens up in the main window as WELL as a new window.

I'll try that one you suggest ?
Copy linkTweet thisAlerts:
@felgallDec 03.2005 — You need [b]onmousedown="return false;"[/b] in the <a> tag to stop the href from running when the browser supports Javascript and can open the image in a separate window.
Copy linkTweet thisAlerts:
@hunky_artistauthorDec 04.2005 — ahh... so how would that appear... like this?

[INDENT]<a href="bluelarge.htm">

<img src="paintings/bluestandardviewsmaller.jpg" alt="Click here for larger image" width="310" height="377" border="0" onMouseDown="MM_openBrWindow('bluelarge.htm','Blue','width=494,height=600') ; return false"></a>[/INDENT]

...or did i miss something out, or maybe done something in the wrong order?

thanks for this ?
Copy linkTweet thisAlerts:
@CharlesDec 04.2005 — You'll find that my example does work, however.
Copy linkTweet thisAlerts:
@felgallDec 04.2005 — The return false would need to be on the <a> tag not the <img> tag. Charles' code is a much better solution than what you are currently using.
Copy linkTweet thisAlerts:
@hunky_artistauthorDec 05.2005 — thanks charles... i was going to try them both in order, lol... just got here again first and saw someone else offering help.

I'll give it a go ?

thanks everyone!!
Copy linkTweet thisAlerts:
@hunky_artistauthorDec 08.2005 — hi there I've tried this, (the charles version) and in firefox it does indeed bring up the new window without changing the existing window.

I can't seem to get the new window to come up at the specified size i need (as in my old code above)

could someone show me how to une my example above using the charles method... i'm obviously missing something as no matter how I tried I could never get it to work as needed....

thanks! ?
Copy linkTweet thisAlerts:
@CharlesDec 08.2005 — &lt;a href="the-big-picture.png" onclick="window.open (this.href, 'child', 'width=494,height=600'); return false"&gt;
&lt;img alt="The big picture" src="thumbnail.png"&gt;
&lt;/a&gt;
Copy linkTweet thisAlerts:
@hunky_artistauthorDec 13.2005 — thanks charles! worked a treat... just gone through my entire site changing all my art pics using that method.

Thanks a load!! ?
Copy linkTweet thisAlerts:
@Mr__RamDec 27.2005 — The problem with the code is that window.open is asynchronous. How can I get alert message in Firefox?

<script>

function fun()

{

var hh, h=null;

if (window.showModalDialog)
{

h = window.showModalDialog("hellos.html", hh);

}

else

{

h = window.open("hellos.html", hh, "left=100,top=100,width=550,height=300,dependent,modal");

window.onfocus=function()
{
if(h && !h.closed)
{
h.focus();
}
}
return false;
}
alert("hai");

}

</script>
×

Success!

Help @hunky_artist 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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