Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To add to the answers of Ryley and atonyc, you don't actually have to use a real CSS property, like <code>text-index</code> or <code>border-spacing</code>, but instead you can specify a fake CSS property, like <code>rotation</code> or <code>my-awesome-property</code>. It might be a good idea to use something that does not risk becoming an actual CSS property in the future. </p> <p>Also, somebody asked how to animate other things at the same time. This can be done as usual, but remember that the <code>step</code> function is called for every animated property, so you'll have to check for your property, like so:</p> <pre><code>$('#foo').animate( { opacity: 0.5, width: "100px", height: "100px", myRotationProperty: 45 }, { step: function(now, tween) { if (tween.prop === "myRotationProperty") { $(this).css('-webkit-transform','rotate('+now+'deg)'); $(this).css('-moz-transform','rotate('+now+'deg)'); // add Opera, MS etc. variants $(this).css('transform','rotate('+now+'deg)'); } } }); </code></pre> <p>(Note: I can't find the documentation for the "Tween" object in the jQuery documentation; from <a href="http://api.jquery.com/animate/" rel="noreferrer">the animate documentation page</a> there is a link to <a href="http://api.jquery.com/Types#Tween" rel="noreferrer">http://api.jquery.com/Types#Tween</a> which is a section that doesn't appear to exist. You can find the code for the Tween prototype on Github <a href="https://github.com/jquery/jquery/blob/master/src/effects.js" rel="noreferrer">here</a>). </p>
 

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