Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery cannot make .click to work on this code
    text
    copied!<p>i have the following problem:</p> <p>i want the animation to start on click instaed of on ready ... it works when it is set on .ready but no when on .click</p> <pre><code>$('div.main').ready(function() { setTimeout("$('div#tl').css({'top' : '-175px', 'left' : '-175px'})", 100); setTimeout("$('div#t').css({'top' : '-175px'})", 300); setTimeout("$('div#tr').css({'top' : '-175px', 'left' : '325px'})", 500); setTimeout("$('div#r').css({'left' : '325px'})", 700); setTimeout("$('div#br').css({'top' : '325px', 'left' : '325px'})", 900); setTimeout("$('div#b').css({'top' : '325px'})", 1100); setTimeout("$('div#bl').css({'top' : '325px', 'left' : '-175px'})", 1300); setTimeout("$('div#l').css({'left' : '-175px'})", 1500); }); </code></pre> <p>here is the HTML:</p> <pre><code>&lt;div class="main"&gt; &lt;div class="sub" id="tl"&gt;&lt;/div&gt; &lt;div class="sub" id="t"&gt;&lt;/div&gt; &lt;div class="sub" id="tr"&gt;&lt;/div&gt; &lt;div class="sub" id="r"&gt;&lt;/div&gt; &lt;div class="sub" id="br"&gt;&lt;/div&gt; &lt;div class="sub" id="b"&gt;&lt;/div&gt; &lt;div class="sub" id="bl"&gt;&lt;/div&gt; &lt;div class="sub" id="l"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>and here the CSS:</p> <pre><code>div.main { position: relative; z-index: 2; width: 300px; height: 300px; margin: 0px auto; top: 50%; margin-top: -150px; background-color: #eee; } div.sub { position: absolute; z-index: 1; top: 75px; left: 75px; width: 150px; height: 150px; background-color: rgba(0,0,0,0.5); -webkit-transition: all 0.3s ease-in-out; } </code></pre>
 

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