PopUp Under With chrome
CedLeb
-
Ane-ô-nime -
Ane-ô-nime -
Bonjour,
J'aimerai bien implémenter un popup under qui fonctionne sur tous les navigateurs y inclus "google chrome".
Le code ci-dessous fonctionne à merveille sur Firefox, IE et SAFARI par contre sur Chrome la popup garde le focus et par conséquent ne se positionne pas derriere la fenêtre principale
Code JQUERY:
-- PopupUnder.js
function PopupUnder(name, url, width, height) {
this.Name = name;
this.Url = url;
this.Width = width;
this.Height = height;
this.Scrollbars = 'yes';
this.Resizable = 'yes';
this.Toolbar = 'yes';
this.MenuBar = 'yes';
this.Status = 'yes';
this.Location = 'yes';
this.Top = '20';
this.Left = '85';
this.Target = '_blank';
this.Options = 'scrollbars=' + this.Scrollbars + ', resizable=' + this.Resizable + ', toolbar=' + this.Toolbar + ', menubar=' + this.MenuBar + ', status=' + this.Status + ', location=' + this.Location + ', left=' + this.Left + ' top=' + this.Top + ', height=' + this.Height + ',width=' + this.Width;
}
PopupUnder.prototype.Open = function() {
var win2 = window.open(this.Url, this.Name, this.Options, this.Target);
win2.blur();
setTimeout('window.focus()', 100);
}
fichier html:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test Opener%3
J'aimerai bien implémenter un popup under qui fonctionne sur tous les navigateurs y inclus "google chrome".
Le code ci-dessous fonctionne à merveille sur Firefox, IE et SAFARI par contre sur Chrome la popup garde le focus et par conséquent ne se positionne pas derriere la fenêtre principale
Code JQUERY:
-- PopupUnder.js
function PopupUnder(name, url, width, height) {
this.Name = name;
this.Url = url;
this.Width = width;
this.Height = height;
this.Scrollbars = 'yes';
this.Resizable = 'yes';
this.Toolbar = 'yes';
this.MenuBar = 'yes';
this.Status = 'yes';
this.Location = 'yes';
this.Top = '20';
this.Left = '85';
this.Target = '_blank';
this.Options = 'scrollbars=' + this.Scrollbars + ', resizable=' + this.Resizable + ', toolbar=' + this.Toolbar + ', menubar=' + this.MenuBar + ', status=' + this.Status + ', location=' + this.Location + ', left=' + this.Left + ' top=' + this.Top + ', height=' + this.Height + ',width=' + this.Width;
}
PopupUnder.prototype.Open = function() {
var win2 = window.open(this.Url, this.Name, this.Options, this.Target);
win2.blur();
setTimeout('window.focus()', 100);
}
fichier html:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Test Opener%3
A voir également:
- PopUp Under With chrome
- Mise a jour chrome - Accueil - Applications & Logiciels
- Google chrome - Télécharger - Navigateurs
- Exporter favoris chrome - Guide
- Changer dns chrome - Guide
- Fake mcafee popup - Accueil - Piratage
3 réponses
Ton script de blur est dans ta popup ou dans ta page principale ?
Il faudrait p-e utiliser des doubles actions sur ta page principale et sur ta popup... mais effectivement il faudrait vérifier comment Chrome gère le blur...
Il faudrait p-e utiliser des doubles actions sur ta page principale et sur ta popup... mais effectivement il faudrait vérifier comment Chrome gère le blur...
sauf que je fais un timeout car sous IE il faut attendre que la popup soit completement chargé pour apres repasser la main à la fenêtre principale.
cf- code:
var win2 = window.open(this.Url, this.Name, this.Options, this.Target);
win2.blur();
setTimeout('window.focus()', 100);
J'ai l'impression que Chrome s'en fou complètement de la methode blur() et focus()
...