Javascript pop up windows resize availheight

waso Messages postés 3 Date d'inscription jeudi 17 avril 2003 Statut Membre Dernière intervention 26 juillet 2003 - 25 juil. 2003 à 21:49
bocrapo Messages postés 1 Date d'inscription mercredi 13 août 2003 Statut Membre Dernière intervention 23 mars 2004 - 23 mars 2004 à 11:18
:question) Pourquoi ca ca marche
<SCRIPT LANGUAGE="JavaScript">
<!--
function OpenSWindow(url){

var platform;
var browser;
var version;

version = parseInt(navigator.appVersion);

if(navigator.userAgent.indexOf('Win') == -1) {
platform = 'Macintosh';
} else {
platform = 'Windows';
}

if(navigator.appName.indexOf('Netscape') == -1) {
browser = 'IE';
} else {
browser = 'Netscape';
}

var aw = screen.availWidth;
var ah = screen.availHeight;

if (browser == 'Netscape') {
aw = aw-12;
ah = ah-30;
}

if (browser == 'IE') {
var fenetre=window.open(url,"Fullscreen","fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=50,left=50");
fenetre.resizeTo(766,606);
}
else
{
window.open(url,"Fullscreen","height="+(606)+",width="+(766)+",fullscreen=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=50,left=50");
}
}
function nommerFenetre() {
window.name='mainwindow'
}
</SCRIPT>

et pas ca
<SCRIPT LANGUAGE="JavaScript">
<!--
function OpenSWindow(url){

var platform;
var browser;
var version;

version = parseInt(navigator.appVersion);

if(navigator.userAgent.indexOf('Win') == -1) {
platform = 'Macintosh';
} else {
platform = 'Windows';
}

if(navigator.appName.indexOf('Netscape') == -1) {
browser = 'IE';
} else {
browser = 'Netscape';
}

var aw = screen.availWidth;
var ah = screen.availHeight;

if (browser == 'Netscape') {
aw = aw-12;
ah = ah-30;
}
if (aw > 810) {

if (browser == 'IE') {
var fenetre=window.open(url,"Fullscreen","fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=50,left=50");
fenetre.resizeTo(766,606);
}
else
{
window.open(url,"Fullscreen","height="+(606)+",width="+(766)+",fullscreen=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=50,left=50");
}

else
{
if (browser == 'IE') {
var fenetre=window.open(url,"Fullscreen","fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top=0,left=0");
fenetre.resizeTo(aw,ah);
}
else
{
window.open(url,"Fullscreen","height="+(ah)+",width="+(aw)+",fullscreen=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top=0,left=0");
}
}

function nommerFenetre() {
window.name='mainwindow'
}

</SCRIPT>

????
J'ai juste rajouté un if pis utilisé les variable que je n'utilisait pas
ca fait longtemps que j'ai fait l'autre pis ca marchais parfait.
c justeparce que je fait un petit feature pour ceux qui sont en 800*600
a tu une idée??
Merci d'avance!!
A+
Etienne

1 réponse

bocrapo Messages postés 1 Date d'inscription mercredi 13 août 2003 Statut Membre Dernière intervention 23 mars 2004
23 mars 2004 à 11:18
Tu as seulement oublié des acollades fermantes...
A+

<SCRIPT LANGUAGE="JavaScript">
<!--
function OpenSWindow(url)
{

var platform;
var browser;
var version;

version = parseInt(navigator.appVersion);

if(navigator.userAgent.indexOf('Win') == -1)
{
platform = 'Macintosh';
}
else
{
platform = 'Windows';
}

if(navigator.appName.indexOf('Netscape') == -1)
{
browser = 'IE';
}
else
{
browser = 'Netscape';
}

var aw = screen.availWidth;
var ah = screen.availHeight;

if (browser == 'Netscape')
{
aw = aw-12;
ah = ah-30;
}
if (aw > 810)
{

if (browser == 'IE')
{
var fenetre=window.open(url,"Fullscreen","fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=50,left=50");
fenetre.resizeTo(766,606);
}
else
{
window.open(url,"Fullscreen","height="+(606)+",width="+(766)+",fullscreen=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=50,left=50");
}

}

else
{
if (browser == 'IE')
{
var fenetre=window.open(url,"Fullscreen","fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top=0,left=0");
fenetre.resizeTo(aw,ah);
}
else
{
window.open(url,"Fullscreen","height="+(ah)+",width="+(aw)+",fullscreen=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,top=0,left=0");
}
}

}

function nommerFenetre() {
window.name='mainwindow'
}

</SCRIPT>
0
Rejoignez-nous