Markus said:
Did you checked the link i posted in my first entry ?
I did this :
http://www.tweakpc.de/?news_id=8100
link :
<a href="/screenshot?show=p4_7ghz_memesama_big.jpg"
onclick="popup(this, 900, 800); return false" target="_blank"><img
class="newspic_click" src="/newspics/p4_7ghz_memesama.jpg" alt="Bild"
title="Zum vergrößern klicken" /> said:
I have a Mac :-/
and obtain 2 new windows (with big jpg and some moving decorations)
one in "normal" blank
other by window.open()
ok i forgot to insert the hole Script. Here it is:
function popup(element, width, height) {
if (element.getAttribute) {
url = element.getAttribute('href');
} else {
url = element;
}
new_window = window.open(url, '_blank', 'width=' + width + ', height='
+ height + ', left=' + Math.round((screen.width - width)/2) + ', top='
+ Math.round((screen.height - height)/4) + ', location=0, statusbar=0,
menubar=0, toolbar=0, scrollbars=1, resizable=yes');
}
it is status and not statusbar
try to do not have spaces in the attributes of window.open()
If Javascript is enabled it should be there one new window with witdh
of 850 and height of 800. And if javascript disabled the big picture
should be open in an fresh ne window (target="_blank").
It seems it would have to ...
Perhaps, if you could try giving same target (as you do)
- to the link
- to the window.open()
but with a real name insteed of "_blank" (i.e : "somewhere")
It also would be interresting you see what exactly does :
screenshot?show=
Dont understand ? the part _return false_ is used if javascript is
enabled to prevent the browser to open the new site in an extra new
full window.
Yes usualy, but you use "_blank" as target in your popup ...
try without target in your popup function :
new_window = window.open(element.href,'',' blah blah ');
and ... I made a mistake :
to do not have blank window AND popup you would have to do :
function popup(width,height) {
new_window = window.open('','truc','width=' + width + ',height='
+ height + ', left=' + Math.round((screen.width - width)/2) + ',top='
+ Math.round((screen.height - height)/4) +
',location=0,status=0,menubar=0,toolbar=0,scrollbars=1,resizable=1');
}
and your link would have to be :
<a href="/screenshot?show=p4_7ghz_memesama_big.jpg"
target="truc"
your post was clear
the JS result of your link not too much :-/
my example (based on your JS) is here :
http://perso.wanadoo.fr/stephane.moriaux/truc/popup.htm
(it works fine with my FF)