Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Praveen's solution should be closer to what you asked for, but I'll provide a solution <a href="https://developer.mozilla.org/en-US/docs/CSS/Tutorials/Using_CSS_animations">using CSS3 animations</a> instead of using jQuery to animate transitions. IMO it is easier to maintain and understand:</p> <p><strong>CSS</strong></p> <pre><code>@-webkit-keyframes foo { from { -webkit-transform:scale(1); } to { -webkit-transform:scale(2); } } </code></pre> <p>Then JS:</p> <pre><code>$("#msg").click(function() { var duration = 1400; $msg = $(this); //syntax is: animation-name animation-duration[ animation-timing-function][ animation-delay][ animation-iteration-count][ animation-direction] $msg.css("animation", "foo " + duration + "ms ease infinite alternate"); }); </code></pre> <p><a href="http://jsfiddle.net/sFxPk/1/"><strong>Fiddle</strong></a></p> <p>I didn't use the optional <code>animation-delay</code> parameter in the above, the rest should be pretty straightforward. <code>infinite</code> iteration count with <code>alternate</code> direction will execute the animation indefinitely alternating the animation direction from (<code>from</code> to <code>to</code> ) to (<code>to</code> to <code>from</code>) until you call <code>$msg.css("animation", "")</code> to remove the animation.</p> <p>ps. jQuery 1.8+ will do the prefixing in the JS automatically for you.<br> Of course, you still have to prefix the CSS to work in non-webkit browsers though. <a href="http://prefixr.com/">Prefixr</a> should do it.</p> <p><a href="http://jsfiddle.net/sFxPk/2/"><strong>Fiddle</strong></a> with prefixed CSS.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload