Bonjour,

Je suis actuellement étudiante en stage d'entreprise et je dois réaliser entre autres choses un programme dont la page d'accueil doit être en javascript(le chef de projet, qui est absent en ce moment, a déjà codé cette page en HTML, je me base donc dessus). Je suis dessus depuis une semaine mais je n'arrive pas à afficher cette page (j'obtiens juste le fond en couleur noire)...
Mon architecture est la suivante: j'ai une page avec mes fonctions js (je ne la mets pas ici), une autre avec ma page d'accueil en js, une page html qui appellera au final cette page js et qui se chargera d'afficher l'accueil,une feuille de style.

Quelqu'un peut-il me donner un coup de main en jetant un oeil sur mon code?
Merci beaucoup!

feuille sur laquelle je me base:
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
22
23
24
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
<div id="button_calender" class="button" onmouseover="javascript:displayPreview('button_calender')" 
onmouseout="javascript=initPage('button_calender')">
<a href="index.php?option=com_jtagcalendar&amp;view=main&amp;Itemid=121">
<img src="image/button_calendar.png" alt="button calendar" border="0" height="127" width="253" /></a></div>
 
<div id="button_transaction" class="button" onmouseover="javascript:displayPreview('button_transaction')" onmouseout="javascript=initPage('button_transaction')"><a href="index.php?option=com_content&amp;view=article&amp;id=6:salon-virtuel&amp;catid=14:salon-virtuel&amp;Itemid=127"><img src="image/button_expo.png" alt="button expo" border="0" height="127" width="253" /></a></div>
 
<div id="button_ecoData" class="button" onmouseover="javascript:displayPreview('button_ecoData')" onmouseout="javascript=initPage('button_ecoData')"><a href="index.php?option=com_content&amp;view=article&amp;id=209&amp;Itemid=276"><img src="image/button_ecoData.png" alt="button ecoData" border="0" height="127" width="253" /></a></div>
 
<div id="button_expert" class="button" onmouseover="javascript:displayPreview('button_expert')" onmouseout="javascript=initPage('button_expert')"><a href="index.php?option=com_content&amp;view=article&amp;id=15&amp;Itemid=144"><img src="image/button_expert.png" alt="button expert" border="0" height="127" width="253" /></a></div>
 
<div id="button_expo" class="button" onmouseover="javascript:displayPreview('button_expo')" onmouseout="javascript=initPage('button_expo')"><img src="image/button_transaction.png" alt="button transaction" border="0" height="127" width="253" /></div>
 
<div id="button_jobs" class="button" onmouseover="javascript:displayPreview('button_jobs')" onmouseout="javascript=initPage('button_jobs')"><img src="image/button_jobs.png" alt="button jobs" border="0" height="127" width="253" /></div>
 
<div id="button_smallAds" class="button" onmouseover="javascript:displayPreview('button_smallAds')" onmouseout="javascript=initPage('button_smallAds')"><img src="image/button_smallAds.png" alt="button smallAds" border="0" height="127" width="253" /></div>
 
<div id="button_socialNetwork" class="button" onmouseover="javascript:displayPreview('button_socialNetwork')" onmouseout="javascript=initPage('button_socialNetwork')"><a href="index.php?option=com_community&amp;view=frontpage&amp;Itemid=264"><img src="image/button_socialNetwork.png" alt="button socialNetwork" border="0" height="127" width="253" /></a></div>
 
<div id="button_toolsBox" class="button" onmouseover="javascript:displayPreview('button_toolsBox')" onmouseout="javascript=initPage('button_toolsBox')"><a href="index.php?option=com_content&amp;view=article&amp;id=243:accueil-outils&amp;catid=110:toolbox&amp;Itemid=217"><img src="image/button_toolsBox.png" alt="button toolsBox" border="0" height="127" width="253" /></a>
 
</div>


Ma feuille JS (je n'ai pas tout fait, vu que je suis bloquée dès la 1ère image)

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
var mainDiv = document.createElement('div');
 
var newDiv = document.createElement('div');
newDiv.setAttribute("class", "background");
mainDiv.appendChild(newDiv);
 
var newOtherDiv = document.createElement('div');
newOtherDiv.setAttribute("class", "page");
 newDiv.appendChild(newOtherDiv);
 
var p = document.createElement('div');
p.setAttribute("class", "layout");
 newOtherDiv.appendChild(p);
 
var t = document.createElement('div');
t.id = 'preview';
t.setAttribute("class", "hidden");
p.appendChild(t);
 
var newText = document.createTextNode(' ');
t.appendChild(newText);
 
var tSuite =  document.createElement('div');
tSuite.id = 'previewSelect';
tSuite.setAttribute("class", "hidden previewPanel");
p.appendChild(tSuite);
 
var newText = document.createTextNode(' ');
tSuite.appendChild(newText);
 
var v_div = document.createElement("div");
  v_div.id = 'button_calendar';
  v_div.setAttribute("class", "button button_calendar"); 
 
var ele_JS = document.createAttribute('OnMouseOver');
ele_JS.nodeValue = "javascript:displayPreview('button_calendar')";
v_div.setAttributeNode(ele_JS);
 
var souris = document.createAttribute('onmouseout');
souris.nodeValue = "javascript=initPage('button_calendar')";
v_div.setAttributeNode(souris);
 
p.appendChild(v_div);
document.body.appendChild(mainDiv);
//document.getElementById('toto').appendChild(mainDiv);

Page finale qui appelera ma JS:
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style_accueil.css">
<script type='text/javascript' src='accueilJS.js'></script>
</head>
<!-- load the page panel -->
<body><div id="toto"></div></body></html>
<script>document.getElementById('toto').appendChild(mainDiv);
</script>
Ma CSS:
Code css : 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
		.background {
		background-color: #000000;
		position: relative;
        margin-top: 0px;
        margin-bottom: 0px;
        margin-left: auto;
        margin-right: auto;
        height:    1080px;
        background-image:url(welcomePageBackground.png);
        background-repeat: no-repeat;
        }
 
        .page {
        position: relative;
        margin-left: auto;
        margin-right: auto;
        width:    1024px;
        height:    667px;
        }
 
        #layout {
        position: absolute;
        margin-top: 80px;
        width:    1024px;
        height:    667px;
        background-image:url(image/t6.jpg);
        background-repeat: no-repeat;
        border: 1px;
        border-style: solid;
        border-color: #81796c;
        border-radius: 20px;
        }
 
 
 
        .hidden {
        display: none;
        }
 
        .visible {
        display: inline;
        }
 
 
 
        .previewPanel {
        position: absolute;
        width: 292px;
        height: 355px;
        opacity: 1;
        border:1px solid #81796c;
        filter:alpha(opacity=100);
        top: 167px;
        left: 395px;
        z-index: 15;
        border-radius: 10px;
        background-repeat: no-repeat;
        }
 
        .previewPanelV
        {
            width:400px;
            height:262px;
            top:200px;
            left:350px;
            border:1px solid #81796c;
 
        }
 
        .previewbutton_calendar {
        background-image:url(image/preview.png);
        }
        .previewbutton_expert {
        background-image:url(image/previewce.png);
        }
        .previewbutton_socialNetwork {
        background-image:url(image/previewrs.png);
        }
        .previewbutton_toolsBox {
        background-image:url(image/previewbo.png);
        }
        .previewbutton_expo{
        border:none;
        }
        .previewbutton_transaction {
        background-image:url(image/previewsv.png);
        }
        .previewbutton_ecoData {
        background-image:url(image/previewde.png);
        }
        .previewbutton_jobs {
        border:none;
        }
        .previewbutton_smallAds {
        border:none;
        }
 
        .button {
        position: absolute;
        cursor: pointer;
        width: 253px;
        height: 127px;
        }
 
        .button img:hover {
        margin: auto;
        width: 278px;
        height: 139px;
        }
 
        #button_calendar { 
        top: 47px;
        left: 193px;
        }
        #button_transaction {
        top: 13px;
        left: 411px;
        }
 
 
        #button_ecoData {
        top: 503px;
        left: 192px;
        }
 
        #button_expert {
        top: 288px;
        left: 795px;
        }
 
        #button_expo {
        top: 208px;
        left: 48px;
        }
 
        #button_jobs {
        top: 468px;
        left: 727px;
        }
 
        #button_smallAds {
        top: 388px;
        left: 0px;
        }
 
        #button_socialNetwork {
        top: 50px;
        left: 669px;
        }
 
        #button_toolsBox {
        top: 525px;
        left: 504px;
        }
 
        .buttonMouseOver {
        z-index: 20;
        }
 
        .buttonMouseOut {
        z-index: 0;
        }