I have an image that I want to stretch for 3 seconds, then pause for 2 seconds and then not stretch for 3 seconds. Be that as it may, I do not know how to do this; Animation delay only works at the beginning of the animation, not in the middle. Here is my code:
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Page 2</title> <style type="text/css"> /* Your styles go here */ img { width:200px; height:100px; animation: widthChange 6s; -webkit-animation: widthChange 6s; -moz-animation: widthChange 6s; -0-animation: widthChange 6s; } p {text-align:center} button {margin:20px} .stylized { font-style: italic; border-width: 5px; border-color: yellow; border-style: outset; } @-webkit-keyframes widthChange { 0%, 100% {width: 200px;} 50% {width: 400px;} } @-o-keyframes widthChange { 0%, 100% {width: 200px;} 50% {width: 400px;} } @-moz-keyframes widthChange { 0%, 100% {width: 200px;} 50% {width: 400px;} } @keyframes widthChange { 0%, 100% {width: 200px;} 50% {width: 400px;} } </style> <script src="http://code.jquery.com/jquery.min.js"></script> <script type="text/javascript"> $(function(){ </script> </head> <body> <img class = "image" src="elephant.jpg" alt="elephant"/> <p><button id="button1">Button 1</button><button id="button2">Button 2</button><button id="button3">Button 3</button></p> </body> </html>
javascript jquery html css animation
Franc tocci
source share