Bonjour,
Je souhaiterais faire un menu identique à ce site internet. Je sais qu'il à été réalisé sous JQuery ici.
Pouvez-vous me donner le nom et ou le script JQuery qui permet de réaliser ce telle menu.
Je vous remercie beaucoup.
Bonne soirée.
Bonjour,
Je souhaiterais faire un menu identique à ce site internet. Je sais qu'il à été réalisé sous JQuery ici.
Pouvez-vous me donner le nom et ou le script JQuery qui permet de réaliser ce telle menu.
Je vous remercie beaucoup.
Bonne soirée.
Ben regarde le code source![]()
Pas de question technique par MP !
Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
Mes formations video2brain : La formation complète sur JavaScript • JavaScript et le DOM par la pratique • PHP 5 et MySQL : les fondamentaux
Mon livre sur jQuery
Module Firefox / Chrome d'intégration de JSFiddle et CodePen sur le forum
C'est déjà fait. Mais le soucis, est que je rencontre des soucis, j'aurais donc bien voulu un code propre pour le faire bien : - (
Bonjour
Voici de quoi amplifier votre souci de soucis.C'est déjà fait. Mais le soucis, est que je rencontre des soucis, j'aurais donc bien voulu un code propre pour le faire bien : - (
Il y a un tutoriel : Créer un menu animé fluide avec jQuery, n'oubliez pas de lire les commentaires . Et voici le code du test que j'avais réalisé à l'époque.
Et voici le code de la "bonne version" du plugin easing :
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
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 <!doctype html> <html lang="fr"> <head> <meta charset="utf-8"> <meta name="Author" content="Daniel Hagnoul"> <title>Forum jQuery</title> <style> /* Base */ div,p,h1,h2,h3,h4,h5,h6,ul,ol,dl,form,table,img {margin:0px; padding:0px; } body {background-color:#dcdcdc; color:#000000; font-family:sans-serif; font-size:medium; font-style:normal; font-weight:normal; line-height:normal; letter-spacing:normal; } h1,h2,h3,h4,h5 {font-family:serif; padding:6px; } p, div, td {word-wrap:break-word; } pre, code {white-space:pre-wrap; word-wrap:break-word; } img, input, textarea, select {max-width:100%; } img {border:none; } h1 {font-size:2em; text-shadow: 4px 4px 4px #bbbbbb; text-align:center; } p {padding:6px; } ul,ol,dl {list-style:none; padding-left:6px; padding-top:6px; } li {padding-bottom:6px; } .conteneur {width:95%; min-width:800px; min-height:400px; margin:12px auto; background-color:#FFFFFF; color:#000000; border:1px solid #666666; } /* rollover menu */ /* menu horizontal */ div#rolloverMenuHori { width:100%; border:1px solid red; } div#rolloverMenuHori p { margin:12px; } div#rolloverMenuHori ul { margin-left:12px; margin-bottom:12px; } div#rolloverMenuHori ul li { list-style-type:none; width:100px; height:50px; color:#191919; text-align:center; overflow:hidden; } div#rolloverMenuHori ul li div { float:left; font-family:"Times New Roman", Times, serif; font-size:1em; font-style:italic; font-weight:bold; padding:12px } div#rolloverMenuHori ul li div a { color:#FFF; text-decoration:none; } div#rolloverMenuHori ul li div.subtext { float:left; font-style:normal; font-weight:normal; padding-top:12px; } /* menu vertical */ div#rolloverMenuVert { width:100%; height:250px; border:1px solid blue; } div#rolloverMenuVert p { margin:12px; } div#rolloverMenuVert ul { margin-left:12px; margin-bottom:12px; } div#rolloverMenuVert ul li { list-style-type:none; float:left; width:100px; height:50px; color:#191919; text-align:center; overflow:hidden; } div#rolloverMenuVert ul li div { font-family:"Times New Roman", Times, serif; font-size:1em; font-style:italic; font-weight:bold; padding:12px } div#rolloverMenuVert ul li div a { color:#FFF; text-decoration:none; } div#rolloverMenuVert ul li div.subtext { font-style:normal; font-weight:normal; padding-top:12px; } /*Menu Color Classes*/ .green{background:#6AA63B;} .yellow{background:#FBC700;} .red{background:#D52100;} .purple{background:#5122B4;} .blue{background:#0292C0;} </style> </head> <body> <h1>Forum jQuery</h1> <section class="conteneur"> <div id="rolloverMenuHori"> <p>Rollover a menu item to expand it.</p> <ul> <li class="green"> <div><a href="#">Home</a></div> <div class="subtext">The front page</div> </li> <li class="yellow"> <div><a href="#">About</a></div> <div class="subtext">More info</div> </li> <li class="red"> <div><a href="#">Contact</a></div> <div class="subtext">Get in touch</div> </li> <li class="blue"> <div><a href="#">Submit</a></div> <div class="subtext">Send us your stuff!</div> </li> <li class="purple"> <div><a href="#">Terms</a></div> <div class="subtext">Legal things</div> </li> </ul> </div> <div id="rolloverMenuVert"> <p>Rollover a menu item to expand it.</p> <ul> <li class="green"> <div><a href="#">Home</a></div> <div class="subtext">The front page</div> </li> <li class="yellow"> <div><a href="#">About</a></div> <div class="subtext">More info</div> </li> <li class="red"> <div><a href="#">Contact</a></div> <div class="subtext">Get in touch</div> </li> <li class="blue"> <div><a href="#">Submit</a></div> <div class="subtext">Send us your stuff!</div> </li> <li class="purple"> <div><a href="#">Terms</a></div> <div class="subtext">Legal things</div> </li> </ul> </div> <p style="clear:both"> </p> </section> <footer itemscope itemtype="http://data-vocabulary.org/Person"> <!-- Date ISO format long US : aaaa-mm-qqThh:mm:ss.nnn+hh:mm --> <time datetime="2011-05-20T11:20:00.000+02:00" pubdate>2011-05-20</time> <span itemprop="name">Daniel Hagnoul</span> <a href="http://www.developpez.net/forums/u285162/danielhagnoul/" itemprop="url">@danielhagnoul</a> </footer> <script charset="utf-8" src="http://code.jquery.com/jquery-1.6.1.min.js"></script> <script charset="utf-8" src="../lib/jquery-easing-1.3.js"></script> <script> $(function(){ $("div#rolloverMenuHori ul li").mouseenter(function(){ $(this).stop().animate({ height:'50px', width:'200px' }, { queue:false, duration:600, easing: 'easeOutBounce' }); }); $("div#rolloverMenuHori ul li").mouseleave(function(){ $(this).stop().animate({ height:'50px', width:'100px' }, { queue:false, duration:600, easing: 'easeOutBounce' }); }); $("div#rolloverMenuVert ul li").mouseenter(function(){ $(this).stop().animate({ height:'150px', width:'100px' }, { queue:false, duration:600, easing: 'easeOutBounce' }); }); $("div#rolloverMenuVert ul li").mouseleave(function(){ $(this).stop().animate({ height:'50px', width:'100px' }, { queue:false, duration:600, easing: 'easeOutBounce' }); }); }); </script> </body> </html>
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
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 /* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend( jQuery.easing, { def: 'easeOutQuad', swing: function (x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function (x, t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t + b; return -c/2 * ((--t)*(t-2) - 1) + b; }, easeInCubic: function (x, t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeInQuart: function (x, t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 * ((t-=2)*t*t*t - 2) + b; }, easeInQuint: function (x, t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function (x, t, b, c, d) { if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t/d * (Math.PI/2)) + c + b; }, easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t/d * (Math.PI/2)) + b; }, easeInOutSine: function (x, t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }, easeInExpo: function (x, t, b, c, d) { return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; }, easeOutExpo: function (x, t, b, c, d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; }, easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t=t/d-1)*t) + b; }, easeInOutCirc: function (x, t, b, c, d) { if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; }, easeInElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; }, easeInOutElastic: function (x, t, b, c, d) { var s=1.70158;var p=0;var a=c; if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin (c/a); if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeInBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b; }, easeOutBounce: function (x, t, b, c, d) { if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b; } else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function (x, t, b, c, d) { if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */
Blog
Sans l'analyse et la conception, la programmation est l'art d'ajouter des bogues à un fichier texte vide.
(Louis Srygley : Without requirements or design, programming is the art of adding bugs to an empty text file.)
lien mort Daniel ?
Ma page Developpez - Mon Blog Developpez
Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
Votre post est résolu ? Alors n'oubliez pas le Tag![]()
Venez sur le Chat de Développez !
Merci Daniel, je vais voir ça.
PS : Oui, dommage le lien est mort.
juste un problème de copier/coller
http://dmouronval.developpez.com/tut...ated-menu.html
Les joies du CSS | Réponses sur forum | Simple comme JS | Essais libres autour de l'API G$$gle Maps
✂ ---------------------------------------------
developpez.net c'est aussi :
✔ Les meilleurs cours et tutoriels pour apprendre le CSS
✔ Les meilleurs cours et tutoriels pour apprendre le (X)HTML
✔ Les meilleurs cours et tutoriels pour apprendre le JavaScript
Ok il n'est plus mort, mais pour le coup il ne s'anime pas du tout ici sous ffx 4
Pourtant je l'ai déja vu fonctionner ...
Ma page Developpez - Mon Blog Developpez
Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
Votre post est résolu ? Alors n'oubliez pas le Tag![]()
Venez sur le Chat de Développez !
Je te remercie beaucoup Daniel.
Déjà une partie en moins. Je vais décortiquer ton code.
Le plus dur à trouver maintenant, pour ma part, est l'apparition du fond blanc transparent.
Bonsoir
C'est la page de démonstration du tutoriel
------
Oops ! C'est corrigé. Il y avait, je ne sais comment, un "(http" !lien mort Daniel ?
http://dmouronval.developpez.com/tut...e-avec-jquery/
-------
Le code de la démostration du tutoriel et mon code de test (version horizontale et verticale) fonctionnent bien.
Blog
Sans l'analyse et la conception, la programmation est l'art d'ajouter des bogues à un fichier texte vide.
(Louis Srygley : Without requirements or design, programming is the art of adding bugs to an empty text file.)
Partager