IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Mise en page CSS Discussion :

animation css fonctionne pas


Sujet :

Animation en CSS

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Profil pro
    Inscrit en
    Février 2007
    Messages
    356
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 356
    Par défaut animation css fonctionne pas
    bonjour à tous

    sur cette page : http://codepen.io/anon/pen/edDng
    le code proposé permet d'animer le menu comme un effet de pancarte qui se balance.

    je suppose que cette animation est créé grace au code :

    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
    	@keyframes swingdown {
    		0% {
    			opacity: .05;
    			transform: rotateX(90deg);
    		}
     
    		30% {			
          opacity: 0.9999;
    			transform: rotateX(-20deg);
    			animation-timing-function: ease-in-out;
    		}
     
    		65% {
    			transform: rotateX(20deg);
    			animation-timing-function: ease-in-out;
    		}
     
    		100% {
    			transform: rotateX(0);
    			animation-timing-function: ease-in-out;
    		}
    	}

    or quand je copie-colle le code sur un site vierge, ca ne fonctionne pas,
    peut etre car le code n'est pas pris en compte.

    Je voulais savoir si vous aviez une solution pourcorriger ce problème ?

    je vous remercie

  2. #2
    Expert confirmé
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 844
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 844
    Par défaut

    essais ce :
    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
    <!DOCTYPE html>
    <html>
    <head>
    <style type="text/css">
     {
        margin: 0; 
        padding: 0;
            box-sizing: border-box;
        }
     
        body {
            padding: 30px; 
            font-family: "Helvetica Neue", helvetica, arial; 
            background: url('http://subtlepatterns.com/patterns/white_carbonfiber.png');
        }
     
        #container {
            position: relative;
            width: 940px;        
        }
     
        #container:after {
            content: "";
            display: block;
            clear: both;
            height: 0;
        }
     
        #menu {
            position: relative;
            float: left;
            width: 100%;
            padding: 0 20px;
            border-radius: 3px;
            box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.15);
            background: #ccc; 
        }
     
        #menu, #menu ul {
            list-style: none;
        }
     
        #menu > li {
            float: left;
            position: relative;
            border-right: 1px solid rgba(0,0,0,.1);
            box-shadow: 1px 0 0 rgba(255,255,255,.25);
            perspective: 1000px;
     
        }
     
        #menu > li:first-child {
            border-left: 1px solid rgba(255,255,255,.25);
            box-shadow: -1px 0 0 rgba(0,0,0,.1), 1px 0 0 rgba(255,255,255,.25);
        }
     
        #menu a {
            display: block;
            position: relative;
            z-index: 10;
            padding: 13px 20px 13px 20px;
            text-decoration: none;
            color: rgba(75,75,75,1);
            line-height: 1;
            font-weight: 600;
            font-size: 12px;
            letter-spacing: -.05em;
            background: transparent;        
            text-shadow: 0 1px 1px rgba(255,255,255,.9);
            transition: all .25s ease-in-out;
     
        }
     
        #menu > li:hover > a {
            background: #333;
            color: rgba(0,223,252,1);
            text-shadow: none;
        }
     
        #menu li ul  {
            position: absolute;
            left: 0;
            z-index: 1;
            width: 200px;
            padding: 0;
            opacity: 0;
            visibility: hidden;
            border-bottom-left-radius: 4px;
            border-bottom-right-radius: 4px;
            background: transparent;
            overflow: hidden;
            transform-origin: 50% 0%;
        }
     
     
        #menu li:hover ul {
     
            padding: 15px 0;
            background: #333;
            opacity: 1;
            visibility: visible;
            box-shadow: 1px 1px 7px rgba(0,0,0,.5);
            animation-name: swingdown;
            animation-duration: 1s;
            animation-timing-function: ease;
     
        }
     
        @keyframes swingdown {
            0% {
                opacity: .05;
                transform: rotateX(90deg);
            }
     
            30% {            
          opacity: 0.9999;
                transform: rotateX(-20deg);
                animation-timing-function: ease-in-out;
            }
     
            65% {
                transform: rotateX(20deg);
                animation-timing-function: ease-in-out;
            }
     
            100% {
                transform: rotateX(0);
                animation-timing-function: ease-in-out;
            }
        }
     
     
        #menu li li a {
            padding-left: 15px;
            font-weight: 400;
            color: #ddd;
            text-shadow: none;
            border-top: dotted 1px transparent;
            border-bottom: dotted 1px transparent;
            transition: all .15s linear;
        }
     
        #menu li li a:hover {
            color: rgba(0,223,252,1);
            border-top: dotted 1px rgba(255,255,255,.15);
            border-bottom: dotted 1px rgba(255,255,255,.15);
            background: rgba(0,223,252,.02);
        }
    </style>
    <head>
    <body>
    <div id="container">
    <ul id="menu">
      <li><a href="#">About Me</a>
            <ul>
                <li><a href="#">Lorem ipsum dolor</a></li>
                <li><a href="#">Maecenas lacinia sem</a></li>
                <li><a href="#">Suspendisse fringilla</a></li>
            </ul>
        </li>
        <li><a href="#">Portfolio</a>
            <ul>
                <li><a href="#">Lorem ipsum dolor</a></li>
                <li><a href="#">Maecenas dignissim fermentum luctus</a></li>
                <li><a href="#">Suspendisse fringilla</a></li>
                <li><a href="#">Lorem ipsum dolor</a></li>
                <li><a href="#">Maecenas lacinia sem</a></li>
                <li><a href="#">Suspendisse fringilla</a></li>
            </ul>
        </li>
        <li><a href="#">Clients</a>
            <ul>
                <li><a href="#">Lorem ipsum dolor</a></li>
                <li><a href="#">Maecenas lacinia sem</a></li>
                <li><a href="#">Suspendisse fringilla</a></li>
            </ul>
        </li>
        <li><a href="#">Contact Me</a>
            <ul>
                <li><a href="#">Lorem ipsum dolor</a></li>
                <li><a href="#">Maecenas dignissim fermentum luctus</a></li>
                <li><a href="#">Suspendisse fringilla</a></li>
            </ul>
        </li>
        <li><a href="#">Support</a></li>
    </ul>
    </div>
    </body>
    </html>

  3. #3
    Membre éclairé
    Profil pro
    Inscrit en
    Février 2007
    Messages
    356
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 356
    Par défaut
    merci hack,
    hélas le problème persiste

  4. #4
    Membre Expert
    Avatar de rodolphebrd
    Homme Profil pro
    Indépendant
    Inscrit en
    Novembre 2012
    Messages
    2 336
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Indépendant
    Secteur : Conseil

    Informations forums :
    Inscription : Novembre 2012
    Messages : 2 336
    Par défaut
    il ne faut pas oublier les préfixes.
    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
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    * {
    	margin: 0;
    	padding: 0;
    	box-sizing: border-box;
    }
    body {
    	padding: 30px;
    	font-family: "Helvetica Neue", helvetica, arial;
    	background: url('http://subtlepatterns.com/patterns/white_carbonfiber.png');
    }
    #container {
    	position: relative;
    	width: 940px;
    }
    #container:after {
    	content: "";
    	display: block;
    	clear: both;
    	height: 0;
    }
    #menu {
    	position: relative;
    	float: left;
    	width: 100%;
    	padding: 0 20px;
    	box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.15);
    	background: #ccc;
    }
    #menu, #menu ul {
    	list-style: none;
    }
    #menu > li {
    	float: left;
    	position: relative;
    	border-right: 1px solid rgba(0,0,0,.1);
    	/*box-shadow*/
    	-webkit-box-shadow: 1px 0 0 rgba(255,255,255,.25);
    	-moz-box-shadow: 1px 0 0 rgba(255,255,255,.25);
    	box-shadow: 1px 0 0 rgba(255,255,255,.25);
    	/*perspective*/
    	-webkit-perspective: 1000px;
    	-moz-perspective: 1000px;
    	-ms-perspective: 1000px;
    	-o-perspective: 1000px;
    	perspective: 1000px;
    }
    #menu > li:first-child {
    	border-left: 1px solid rgba(255,255,255,.25);
    	/*box-shadow*/
    	-webkit-box-shadow: -1px 0 0 rgba(0,0,0,.1), 1px 0 0 rgba(255,255,255,.25);
    	-moz-box-shadow: -1px 0 0 rgba(0,0,0,.1), 1px 0 0 rgba(255,255,255,.25);
    	box-shadow: -1px 0 0 rgba(0,0,0,.1), 1px 0 0 rgba(255,255,255,.25);
    }
    #menu a {
    	display: block;
    	position: relative;
    	z-index: 10;
    	padding: 13px 20px 13px 20px;
    	text-decoration: none;
    	color: rgba(75,75,75,1);
    	font-weight: 600;
    	font-size: 12px;
    	letter-spacing: -.05em;
    	background: transparent;
    	text-shadow: 0 1px 1px rgba(255,255,255,.9);
    	/*transition*/
    	-webkit-transition: all .25s ease-in-out;
    	-moz-transition: all .25s ease-in-out;
    	-o-transition: all .25s ease-in-out;
    	transition: all .25s ease-in-out;
    }
    #menu > li:hover > a {
    	background: #333;
    	color: rgba(0,223,252,1);
    	text-shadow: none;
    }
    #menu li ul {
    	position: absolute;
    	left: 0;
    	z-index: 1;
    	width: 200px;
    	padding: 0;
    	opacity: 0;
    	visibility: hidden;
    	border-bottom-left-radius: 4px;
    	border-bottom-right-radius: 4px;
    	background: transparent;
    	overflow: hidden;
    	/*transform-origin*/
    	-webkit-transform-origin: 50% 0%;
    	-moz-transform-origin: 50% 0%;
    	-ms-transform-origin: 50% 0%;
    	-o-transform-origin: 50% 0%;
    	transform-origin: 50% 0%;
    }
    #menu li:hover ul {
    	padding: 15px 0;
    	background: #333;
    	opacity: 1;
    	visibility: visible;
    	/*box-shadow*/
    	-webkit-box-shadow: 1px 1px 7px rgba(0,0,0,.5);
    	-moz-box-shadow: 1px 1px 7px rgba(0,0,0,.5);
    	box-shadow: 1px 1px 7px rgba(0,0,0,.5);
    	/*animation-name*/
    	-webkit-animation-name: swingdown;
    	-moz-animation-name: swingdown;
    	-ms-animation-name: swingdown;
    	-o-animation-name: swingdown;
    	animation-name: swingdown;
    	/*animation-duration*/
    	-webkit-animation-duration: 1s;
    	-moz-animation-duration: 1s;
    	-ms-animation-duration: 1s;
    	-o-animation-duration: 1s;
    	animation-duration: 1s;
    	/*animation-timing-function*/
    	-webkit-animation-timing-function: ease;
    	-moz-animation-timing-function: ease;
    	-ms-animation-timing-function: ease;
    	-o-animation-timing-function: ease;
    	animation-timing-function: ease;
    }
     @-webkit-keyframes swingdown {
    0% {
     opacity: .99999;
     -webkit-transform:rotateX(90deg);
     -moz-transform:rotateX(90deg);
     -ms-transform:rotateX(90deg);
     -o-transform:rotateX(90deg);
     transform:rotateX(90deg);
    }
     30% {
    -webkit-transform:rotateX(-20deg) rotateY(5deg);
     -moz-transform:rotateX(-20deg) rotateY(5deg);
     -ms-transform:rotateX(-20deg) rotateY(5deg);
     -o-transform:rotateX(-20deg) rotateY(5deg);
     transform:rotateX(-20deg) rotateY(5deg);
    -webkit-animation-timing-function:ease-in-out;
     -moz-animation-timing-function:ease-in-out;
     -ms-animation-timing-function:ease-in-out;
     -o-animation-timing-function:ease-in-out;
     animation-timing-function:ease-in-out;
    }
     65% {
     -webkit-transform:rotateX(-20deg) rotateY(-3deg);
     -moz-transform:rotateX(-20deg) rotateY(-3deg);
     -ms-transform:rotateX(-20deg) rotateY(-3deg);
     -o-transform:rotateX(-20deg) rotateY(-3deg);
     transform:rotateX(-20deg) rotateY(-3deg);
    -webkit-animation-timing-function:ease-in-out;
     -moz-animation-timing-function:ease-in-out;
     -ms-animation-timing-function:ease-in-out;
     -o-animation-timing-function:ease-in-out;
     animation-timing-function:ease-in-out;
    }
     100% {
     transform: rotateX(0);
     -webkit-animation-timing-function:ease-in-out;
     -moz-animation-timing-function:ease-in-out;
     -ms-animation-timing-function:ease-in-out;
     -o-animation-timing-function:ease-in-out;
     animation-timing-function:ease-in-out;
    }
    }
    #menu li li a {
    	padding-left: 15px;
    	font-weight: 400;
    	color: #ddd;
    	text-shadow: none;
    	border-top: dotted 1px transparent;
    	border-bottom: dotted 1px transparent;
    	/*transition*/
    	-webkit-transition: all .15s linear;
    	-moz-transition: all .15s linear;
    	-o-transition: all .15s linear;
    	transition: all .15s linear;
    }
    #menu li li a:hover {
    	color: rgba(0,223,252,1);
    	border-top: dotted 1px rgba(255,255,255,.15);
    	border-bottom: dotted 1px rgba(255,255,255,.15);
    	background: rgba(0,223,252,.02);
    }

  5. #5
    Expert confirmé
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 844
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 844
    Par défaut
    Citation Envoyé par ickyknox Voir le message
    hélas le problème persiste

    C'est quoi votre système ? et la version de votre navigateur ?
    Pour moi ça marche impeccable sur FireFox version 22 avec Win Xp SP3


  6. #6
    Membre éclairé
    Profil pro
    Inscrit en
    Février 2007
    Messages
    356
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 356
    Par défaut
    ahhh bien vu, il manquait en effet les préfixes.
    j'ai Chrome.

    Merci à vous deux pour toutes ces précisions !!!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Menu deroulant css fonctionne pas
    Par clem62173 dans le forum Mise en page CSS
    Réponses: 0
    Dernier message: 26/06/2010, 12h41
  2. Animation ne fonctionne pas sur serveur distant
    Par SNAKE000666 dans le forum Intégration
    Réponses: 3
    Dernier message: 05/08/2008, 19h02
  3. [CSS] a:active ne fonctionne pas toujours ?
    Par KpTn dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 10/05/2006, 17h25
  4. CSS ne fonctionnant pas sous IE
    Par arnaud_verlaine dans le forum Mise en page CSS
    Réponses: 18
    Dernier message: 16/11/2005, 16h51
  5. [CSS] Effet de hover qui ne fonctionne pas sous IE
    Par Ricou13 dans le forum Mise en page CSS
    Réponses: 6
    Dernier message: 14/06/2005, 09h39

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo