Note that there are some explanatory texts on larger screens.

plurals
  1. POScroll jquery animation missing div
    primarykey
    data
    text
    <p>I got a scrool animation pointing to 'step 2' but the animation goes all the way to 'step 3'. Although my link to step 3 seems to work with the same function. I can't figure out why it doesn't stop at the right div, thanks for the help!</p> <p>here's my code: </p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Title of the document&lt;/title&gt; &lt;style&gt; .out{background:gray;height:300px;} .box{height:300px;overflow:auto;} .question1{background:red;height:300px;} .question2{background:green;height:300px;} .question3{background:blue;height:300px;} .question4{background:yellow;height:300px;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="out"&gt; here &lt;/div&gt; &lt;div class="box"&gt; &lt;div class="question1" id="step1"&gt; step 1&lt;br&gt; &lt;a href="#step2"&gt;Step 2&lt;/a&gt; &lt;/div&gt; &lt;div class="question2" id="step2"&gt; step 2&lt;br&gt; &lt;a href="#step3"&gt;step 3&lt;/a&gt; &lt;/div&gt; &lt;div class="question3" id="step3"&gt; step 3 &lt;/div&gt; &lt;div class="question4" id="step4"&gt; step 4 &lt;/div&gt; &lt;/div&gt; &lt;div class="out"&gt; here &lt;/div&gt; &lt;/body&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $('a[href^="#"]').click(function(){ var the_id = $(this).attr("href"); $('.box').animate({ scrollTop:$(the_id).offset().top }, 'slow'); return false; }); }); &lt;/script&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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