Titre: Bug étrange sous FF
Posté par: MarvinLeRouge le le 07-07-2006 a 16:20:02
Salut,
Je viens de constater que le code suivant m'ouvre systématiquement une fenètre 50px moins large que ce qui est demandé. Si quelqu'un trouve le bug, je suis preneur, parce que là, j'en perds mon js.
Code:
function popUpCentre (page, titre, options) { var temp = new String (options); // 1 Extraire la largeur et la hauteur de options var wPos = temp.indexOf ("width="); wPos+= 6; var virgPos = temp.indexOf (",", wPos); virgPos = (virgPos != -1 ? virgPos : temp.length); var width = temp.substring (wPos, virgPos); var hPos = temp.indexOf ("height="); hPos+= 7; virgPos = temp.indexOf (",", hPos); virgPos = (virgPos != -1 ? virgPos : temp.length); var height = temp.substring (hPos, virgPos); var left = (screen.width - width) / 2; var top = (screen.height - height) / 2 - 50; return (window.open (page, titre, "top=" + top + ",left=" + left + "," + options)); } function start () { var popped = popUpCentre ("login.php", "appli_main", "menubar=no, status=no, scrollbars=yes, menubar=no, resizable=yes, width=850, height=600"); if (popped) { history.back(); popped.focus (); } } window.onload = start;
|
|
Merci |
Titre: Re:Bug étrange sous FF
Posté par: Martin. le le 08-07-2006 a 18:04:42
| La console JS de FF ne dit rien ? |
Forum-webmaster | Actionné par YaBB SE
© 2001-2003, YaBB SE Dev Team. Tous droits réservés.
|