Bonsoir à tous (et toutes) !
J'ai un petit souci,
J'ai une page html bourrée de javascript :
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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Meet the crew</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="description" content="Expanding Image Menu with jQuery" /> <meta name="keywords" content="menu, navigation, expanding, image, jquery, bw, slide out, hover, animate"/> <script src="jquery/jquery-1.11.0.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="rockinletters/js/modernizr.custom.66501.js"></script> <link href="rockinletters/css/demo.css" rel="stylesheet" type="text/css" /> <link href="rockinletters/css/style.css" rel="stylesheet" type="text/css" /> <link href='http://fonts.googleapis.com/css?family=Alfa+Slab+One' rel='stylesheet' type='text/css'> <!-- /*effet affichage fadein*/--> <script type="text/javascript"> $(document).ready(function () { $("body").css("display", "none"); $("body").fadeIn(1000); }); </script> </head> <body onload="init()" > <div class="rockcontainer" > <div id="ll-wrapper" class="ll-wrapper" style="margin-bottom:10px"> <h3>MEET</h3> <h3>THE</h3> <h3>CREW</h3> <img style="height :150px; width:150px "src="images/crew1sr.gif" /> </div> </div> <div class="Titre"> <h1>ALL STYLES CREW</h1></div> <link href="MenuCrew/css/reset.css" rel="stylesheet" /> <link href="MenuCrew/css/style.css" rel="stylesheet" /> <div class="container"> <div class="content"> <div id="ei_menu" class="ei_menu"> <ul> <li style="margin-left:112px"> <a href="#" class="pos1"> <span class="ei_preview"></span> <span class="ei_image"></span> </a> <div class="ei_descr"> <h2>MIXAY</h2> <h4>......</h4> <p> ................................................................... .................................................... .................................... </p> <p> ................................................................... ................................. .......................................... </p> </div> </li> <li> <a href="#" class="pos2"> <span class="ei_preview"></span> <span class="ei_image"></span> </a> <div class="ei_descr"> <h2>BENE</h2> <h4>*****</h4> <p> ................................................................... .................................................... .................................... </p> <p> ................................................................... ..................................;;; .......................................... </p> </div> </li> <li> <a href="#" class="pos3"> <span class="ei_preview"></span> <span class="ei_image"></span> </a> <div class="ei_descr"> <h2>DAVID</h2> <h4>*****</h4> <p> ................................................................... .................................................... .................................... </p> <p> ................................................................... ..................................;;; .......................................... </p> </div> </li> <li> <a href="#" class="pos4"> <span class="ei_preview"></span> <span class="ei_image"></span> </a> <div class="ei_descr"> <h2>SNOOP</h2> <h4>*****</h4> <p> ................................................................... .................................................... .................................... </p> <p> ................................................................... ..................................;;; .......................................... </p> </div> </li> <li> <a href="#" class="pos5"> <span class="ei_preview"></span> <span class="ei_image"></span> </a> <div class="ei_descr"> <h2>WESLEY</h2> <h4>*****</h4> <p> ................................................................... .................................................... .................................... </p> <p> ................................................................... ..................................;;; .......................................... </p> </div> </li> <li> <a href="#" class="pos6"> <span class="ei_preview"></span> <span class="ei_image"></span> </a> <div class="ei_descr"> <h2>Joce</h2> <h4>*****</h4> <p> ................................................................... .................................................... .................................... </p> <p> ................................................................... ..................................;;; .......................................... </p> </div> </li> <li> <a href="#" class="pos7"> <span class="ei_preview"></span> <span class="ei_image"></span> </a> <div class="ei_descr" > <h2>IBRA</h2> <h4>*****</h4> <p> ................................................................... .................................................... .................................... </p> <p> ................................................................... ..................................;;; .......................................... </p> </div> </li> </ul> </div> </div> </div> <div id="wrap"><link href="calendrierasc/css/timeline.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="calendrierasc/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="calendrierasc/js/timeline-min.js"></script> <script type="text/javascript" src="calendrierasc/js/callcal.js"></script> <style type="text/css"> #wrap { background : white no-repeat center top; margin : 20px auto 150px auto; width : 900px; } </style> <div id="timeline"> <ul> <li class="B.A.S.E V" title="Sat Jun 14 2014">#RAMENETAFRAISE</li> <li class="Idependance Day" title="Sat Jul 4 2009">Happy independance day America</li> <li class="Jenny's B'day" title="Sun Jul 19 2009">Must get the biggest toy I can to make Jenny really happy :)</li> <li class="American Pie 4 is coming out" title="Thu Jul 23 2009">We really need to watch this movie. The ratings are so high!</li> <li class="DenonStudio is shows off the new Timeline calendar" title="Wed Jul 22 2009">This script is really hot. Can't wait to have it</li> <li class="ThemeForest launches the JavaScript component" title="Fri Jul 31 2009">Make sure to check regularly for hot new scripts</li> <li class="Dentist appointment" title="Wed Jul 22 2009">4:35 pm. Make sure not to eat anything for the last 24 hours. Got I hope I don't die :|</li> </ul> </div> </div> <!--JavaScript --> <script src="rockinletters/js/jquery.animation.js"></script> <script src="rockinletters/js/jquery.lettering.js"></script> <script src="rockinletters/js/modernizr.custom.66501.js"></script> <script type="text/javascript" src="MenuCrew/js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="MenuCrew/js/menujs.js"></script> </body> </html>
Et je n'arrive pas à placer mes scripts pur que tout fonctionne bien.
Au départ j'ai commencé par implémenter le Menu (div class container)
dont voici le javascript :
et les slides fonctionnaient bien,
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
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 $(function () { var $menu = $('#ei_menu > ul'), $menuItems = $menu.children('li'), $menuItemsImgWrapper = $menuItems.children('a'), $menuItemsPreview = $menuItemsImgWrapper.children('.ei_preview'), totalMenuItems = $menuItems.length, ExpandingMenu = (function () { /* @current set it to the index of the element you want to be opened by default, or -1 if you want the menu to be closed initially */ var current, /* @anim if we want the default opened item to animate initialy set this to true */ anim = false, /* checks if the current value is valid - between 0 and the number of items */ validCurrent = function () { return (current >= 0 && current < totalMenuItems); }, init = function () { /* show default item if current is set to a valid index */ if (validCurrent()) configureMenu(); initEventsHandler(); }, configureMenu = function () { /* get the item for the current */ var $item = $menuItems.eq(current); /* if anim is true slide out the item */ if (anim) slideOutItem($item, true, 900, 'easeInQuint'); else { /* if not just show it */ $item.css({ width: '450px' }) .find('.ei_image') .css({ left: '0px', opacity: 1 }); /* decrease the opacity of the others */ $menuItems.not($item) .children('.ei_preview') .css({ opacity: 0.2 }); } }, initEventsHandler = function () { /* when we click an item the following can happen: 1) The item is already opened - close it! 2) The item is closed - open it! (if another one is opened, close it!) */ $menuItemsImgWrapper.bind('click.ExpandingMenu', function (e) { var $this = $(this).parent(), idx = $this.index(); if (current === idx) { slideOutItem($menuItems.eq(current), false, 1500, 'easeOutQuint', true); current = -1; } else { if (validCurrent() && current !== idx) slideOutItem($menuItems.eq(current), false, 250, 'jswing'); current = idx; slideOutItem($this, true, 250, 'jswing'); } return false; }); }, /* if you want to trigger the action to open a specific item */ openItem = function (idx) { $menuItemsImgWrapper.eq(idx).click(); }, /* opens or closes an item note that "mLeave" is just true when all the items close, in which case we want that all of them get opacity 1 again. "dir" tells us if we are opening or closing an item (true | false) */ slideOutItem = function ($item, dir, speed, easing, mLeave) { var $ei_image = $item.find('.ei_image'), itemParam = (dir) ? { width: '400px' } : { width: '130px' }, imageParam = (dir) ? { left: '0px' } : { left: '130px' }; /* if opening, we animate the opacity of all the elements to 0.1. this is to give focus on the opened item.. */ if (dir) /* alternative: $menuItemsPreview.not($menuItemsPreview.eq(current)) .stop() .animate({opacity:0.1}, 500); */ $menuItemsPreview.stop() .animate({ opacity: 0.1 }, 1000); else if (mLeave) $menuItemsPreview.stop() .animate({ opacity: 1 }, 1500); /* the <li> expands or collapses */ $item.stop().animate(itemParam, speed, easing); /* the image (color) slides in or out */ $ei_image.stop().animate(imageParam, speed, easing, function () { /* if opening, we animate the opacity to 1, otherwise we reset it. */ if (dir) $ei_image.animate({ opacity: 1 }, 2000); else $ei_image.css('opacity', 0.2); }); }; return { init: init, openItem: openItem }; })(); /* call the init method of ExpandingMenu */ ExpandingMenu.init(); /* if later on you want to open / close a specific item you could do it like so: ExpandingMenu.openItem(3); // toggles item 3 (zero-based indexing) */ });
puis j'ai ajouté le js rocking letters pour la div rockcontainer,
et j'ai terminé par un petit calendrier ( div timeline)
j'avais donc mon js menu tout en bas, mais le rocking letter ne fonctionnait plus
donc j'ai tout poussé vers le bas, sauf le js du time line, puiqu'il empeche le js du rocking letter de fonctionner lorsqu'il est placé plus bas.
Bref, là il commence a se faire tard, et ça commence à faire presque 4 bonnes heures que je mélange tout, mon pauvre cerveau ramolli ne m'est plus d'aucune aide, alors peut etre le serez vous.. please have mercy !
Merci beaucoup !!
PS: je suppose que les css ne sont pas concernés puisque tout fonctionne individuellement..
Partager