Bonjour mesdames et messieurs
Voici j'essaye de "prendre" ce formulaire (voir http://cssdeck.com/labs/flat-ui-login-form) dans une page à moi
Dans un premier temps je cherche à faire fonctionner la source donnée seule sur mon ordinateur
Mais malheureusement je n'arrive pas à faire fonctionner le clic sur les Tabs pour changer le contenu affiché
Est-ce que ce code est correct ?
J'ai inclus le css aussi même si cela alourdit l'ensemble
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284 <!DOCTYPE html> <html lang="en"> <head> <!-- Basic Page Needs ================================================== --> <meta charset="utf-8"> <title>Flat Login</title> <meta name="description" content=""> <meta name="author" content=""> <style type="text/css"> @import url(http://fonts.googleapis.com/css?family=Roboto:100); @import url(http://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css); body { background: #1a1a1a; color: white; font-family: 'Roboto'; } .flat-form { background: #e74c3c; margin: 25px auto; width: 390px; height: 340px; position: relative; font-family: 'Roboto'; } .tabs { background: #c0392b; height: 40px; margin: 0; padding: 0; list-style-type: none; width: 100%; position: relative; display: block; margin-bottom: 20px; } .tabs li { display: block; float: left; margin: 0; padding: 0; } .tabs a { background: #c0392b; display: block; float: left; text-decoration: none; color: white; font-size: 16px; padding: 12px 22px 12px 22px; /*border-right: 1px solid @tab-border;*/ } .tabs li:last-child a { border-right: none; width: 174px; padding-left: 0; padding-right: 0; text-align: center; } .tabs a.active { background: #e74c3c; border-right: none; -webkit-transition: all 0.5s linear; -moz-transition: all 0.5s linear; transition: all 0.5s linear; } .form-action { padding: 0 20px; position: relative; } .form-action h1 { font-size: 42px; padding-bottom: 10px; } .form-action p { font-size: 12px; padding-bottom: 10px; line-height: 25px; } form { padding-right: 20px !important; } form input[type=text], form input[type=password], form input[type=submit] { font-family: 'Roboto'; } form input[type=text], form input[type=password] { width: 100%; height: 40px; margin-bottom: 10px; padding-left: 15px; background: #fff; border: none; color: #e74c3c; outline: none; } .dark-box { background: #5e0400; box-shadow: 1px 3px 3px #3d0100 inset; height: 40px; width: 50px; } .form-action .dark-box.bottom { position: absolute; right: 0; bottom: -24px; } .tabs + .dark-box.top { position: absolute; right: 0; top: 0px; } .show { display: block; } .hide { display: none; } .button { border: none; display: block; background: #136899; height: 40px; width: 80px; color: #ffffff; text-align: center; border-radius: 5px; /*box-shadow: 0px 3px 1px #2075aa;*/ -webkit-transition: all 0.15s linear; -moz-transition: all 0.15s linear; transition: all 0.15s linear; } .button:hover { background: #1e75aa; /*box-shadow: 0 3px 1px #237bb2;*/ } .button:active { background: #136899; /*box-shadow: 0 3px 1px #0f608c;*/ } ::-webkit-input-placeholder { color: #e74c3c; } :-moz-placeholder { /* Firefox 18- */ color: #e74c3c; } ::-moz-placeholder { /* Firefox 19+ */ color: #e74c3c; } :-ms-input-placeholder { color: #e74c3c; } </style> <script src="jquery.min.js"></script> <script type="text/javascript"> $('.tabs').on('click', 'li a', function(e){ e.preventDefault(); var $tab = $(this), href = $tab.attr('href'); $('.active').removeClass('active'); $tab.addClass('active'); $('.show').removeClass('show').addClass('hide').hide(); $(href).removeClass('hide').addClass('show').hide().fadeIn(550); }); </script> <!-- Mobile Specific Metas ================================================== --> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <!-- CSS ================================================== --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="flat-form"> <ul class="tabs"> <li> <a href="#login" class="active">Login</a> </li> <li> <a href="#register">Register</a> </li> <li> <a href="#reset">Reset Password</a> </li> </ul> <div id="login" class="form-action show"> <h1>Login on webapp</h1> <p> Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Maecenas sed diam eget risus varius bladit sit amet non </p> <form> <ul> <li> <input type="text" placeholder="Username" /> </li> <li> <input type="password" placeholder="Password" /> </li> <li> <input type="submit" value="Login" class="button" /> </li> </ul> </form> </div> <!--/#login.form-action--> <div id="register" class="form-action hide"> <h1>Register</h1> <p> You should totally sign up for our super awesome service. It's what all the cool kids are doing nowadays. </p> <form> <ul> <li> <input type="text" placeholder="Username" /> </li> <li> <input type="password" placeholder="Password" /> </li> <li> <input type="submit" value="Sign Up" class="button" /> </li> </ul> </form> </div> <!--/#register.form-action--> <div id="reset" class="form-action hide"> <h1>Reset Password</h1> <p> To reset your password enter your email and your birthday and we'll send you a link to reset your password. </p> <form> <ul> <li> <input type="text" placeholder="Email" /> </li> <li> <input type="text" placeholder="Birthday" /> </li> <li> <input type="submit" value="Send" class="button" /> </li> </ul> </form> </div> <!--/#register.form-action--> </div> </div> <script class="cssdeck" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> </body> </html>
Merci de l'aide que vous pourriez m'apporter
Partager