Bonjour!

j'ai un petit soucis avec un script sous chrome 23.

je n'arrive pas à faire une popunder elle se place tout le temps devant, je m'arrache les cheveux depuis plusieurs jours...


pourriez vous m'aider à déburner un peu le bouzin?

ça fonctionne sur IE et firefox mais pas chrome 23 je n'y arrive vraiment pas

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
var alreadyClicked = 0;
var pu = function(url,link) {
 
  pop_width = 1100;
  pop_height = 800;
 
  pop_url = url;
  alreadyClicked = 1;
var screenTop = (window.screenTop != undefined) ? window.screenTop : window.screenY;
var screenLeft = (window.screenLeft != undefined) ? window.screenLeft : window.screenX;
var screenW = 0;
var screenH = 0;
if (typeof window.innerWidth == "number") {
screenW = window.innerWidth;
screenH = window.innerHeight;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
screenW = document.documentElement.clientWidth;
screenH = document.documentElement.clientHeight;
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
screenW = document.body.clientWidth;
screenH = document.body.clientHeight;
}
var pxLeft = (screenLeft + (screenW / 2) - (pop_width / 2));
var pxTop = (screenTop + (screenH / 2) - (pop_height / 2));
var win = window.open(pop_url, "", "width=" + pop_width + ", height=" + pop_height + ", scrollbars=yes,resizable=yes,toolbar=no, menubar=no,status=no,location=no,left=" + pxLeft + ",top=" + pxTop);
win.blur();
window.focus();
 
if (typeof win.window.mozPaintCount != "undefined") {
win.window.open("about:blank").close();
window.focus();
}
}
var waiting = function (url,link) {
if (window.chrome) {
link.addEventListener("mousedown", function (e) {
pu(url,link);
});
link.addEventListener("click", function (e) {
if (alreadyClicked == 1) {
alreadyClicked = 2;
window.open("about:blank").close();
}
});
} else {
link.addEventListener("click", pu);
}
}
 
$(document).ready(function(){
if (top = self) {
$(".link_black_grey_bold,.link_black_blue_b_u").click(function() {
var a=$(this).attr('href');
pu(a,this);
});
}else{
$(".link_black_grey_bold_search,.link_black_blue_b_u_search").click(function() {_gaq.push(['_trackEvent', 'clic-search', 'sortie ' + jQuery(this).attr('href')]); });
}
});
et le html

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<html><!--- début de ma page HTML --->
 
<!--- entête de ma page dans lequel j'indique le titre de la fenêtre Windows --->
<head>
<title> Première page </title>
</head>
<script type="text/javascript" src="/jquery-1.8.3.min.js"></script> 
<script type="text/javascript" src="/popunder1.js"></script>
 
 
 
 
<!--- corps de ma page qui contient le texte qui va y apparaître --->
<body>
 
<a href="#" class="link_black_grey_bold">google</a>
<a href="#" class="link_black_grey_bold">libellule</a>
 
</body>
 
</html><!--- fin de ma page HTML --->

il faut la librairie jquery pour tester...


si vous avez besoin de plus d'info je vous les donne sans soucis


merci de votre aide,

Florian