Bonjour,
J'essaye d'afficher un bloc id="googFixed" en position fixed. Quand la taille de la fenêtre est supérieur a 1255px celui-ci s'affiche. Dans ce bloc il y a une publicité adense
Cela fonctionne bien sous FireFox et Chrome il se postionne a top:150px et left:200px de la fenêtre du navigateur. Mais sous IE et opéra il passe en dessous de ma div nomée "id=pubGoo"
Ci-dessous mon code source :
alors que si je place l'adsense en dure, et ne passe pas par du javacript, cela fonctionne plus de bug sous IE et opéra, affichage normal...Code:
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script> <style> div{ border: 1px solid red; } </style> </head> <div align="center" > <!-- header --> <div style="width:936px;height:110px;"> </div> <!-- contenu --> <div style="width:936px;height:900px;" id="pubGoo"> </div> <script type='text/javascript'> var window_width=$(window).width(); if( window_width > 1255) { //var widthRestant = ((window_width - 936)/2)-160; document.write("<div id=\"googFixed\" style=\"position:fixed;top:150px;left:170px;width:165px;height:610px;border:1px solid black;z-index: 210;\">"); document.write("<div style=\"position:relative\">"); document.write("<script type=\"text/javascript\"><!--\n"); document.write("google_ad_client = \"ca-pub-xxxx\";\n"); document.write("/* 160-600-livefoot-index */\n"); document.write("google_ad_slot = \"xxxx\";\n"); document.write("google_ad_width = 160;\n"); document.write("google_ad_height = 600;\n"); document.write("//-->\n"); document.write("</"+"script>\n"); document.write("<script type=\"text/javascript\"\n"); document.write(" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\n"); document.write("</"+"script>\n"); document.write("</div></div>"); } </script> </div> </body> </html>
Code:
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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script> <style> div{ border: 1px solid red; } </style> </head> <div align="center" > <!-- header --> <div style="width:936px;height:110px;"> </div> <!-- contenu --> <div style="width:936px;height:900px;" id="pubGoo"> </div> <div id="googFixed" style="position:fixed;top:150px;left:170px;width:165px;height:610px;border:1px solid black;z-index: 210;"> <script type="text/javascript"><!-- google_ad_client = "ca-pub-xxxx"; google_ad_slot = "xxxx"; google_ad_width = 160; google_ad_height = 600; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> </div> </body> </html>
Pouvez-vous m'aider s'il vous plait ?
Est-ce que quelqu'un a une explication ?
Merci beaucoup pour votre aide