Note that there are some explanatory texts on larger screens.

plurals
  1. POSliding Up <p>s
    primarykey
    data
    text
    <p>I have a simple problem which I am not able to solve properly. I have some divs having 2 <code>&lt;p&gt;</code>s each. The <code>&lt;p&gt;</code>s inside them are displayed <code>display:inline</code>. I want those both <code>&lt;p&gt;</code>s to slide up every 2 seconds and then make the next <code>&lt;div&gt;</code>'s <code>&lt;p&gt;</code> come up. That's somewhat hard to describe. It just like a scrolling up <code>&lt;marquee&gt;</code> but having a delay in between.</p> <p>So here's the <a href="http://jsfiddle.net/w4XMs/" rel="nofollow">fiddle</a>.</p> <p><strong>JS:</strong></p> <pre><code>$(document).ready(function () { var i = 1; $(".major_data .commitment_box .commitment").each(function () { $(this).attr("id", i); i++; }); for (var j = 0; j &lt;= $(".major_data .commitment_box .commitment").length; j++) { if ($(".major_data .commitment_box .commitment").prop("id") == j) { $(".major_data .commitment_box .commitment").animate({ marginTop: "-=40px" }); } } }); </code></pre> <p><strong>CSS:</strong></p> <pre><code>.major_data .commitment_box { text-align: center; height: 40px; overflow: hidden; } .major_data .commitment_box .commitment p { display: inline-block; } .major_data .commitment_box .commitment p:first-child { font-weight: bold; margin-right: 20px; } </code></pre> <p><strong>HTML:</strong></p> <pre><code>&lt;div class="major_data"&gt; &lt;div class="commitment_box"&gt; &lt;div class="commitment"&gt; &lt;p&gt;Alex:&lt;/p&gt; &lt;p&gt;He's works great.&lt;/p&gt; &lt;/div&gt; &lt;div class="commitment"&gt; &lt;p&gt;Alex 1:&lt;/p&gt; &lt;p&gt;He's works great.&lt;/p&gt; &lt;/div&gt; &lt;div class="commitment"&gt; &lt;p&gt;Alex 2:&lt;/p&gt; &lt;p&gt;He's works great.&lt;/p&gt; &lt;/div&gt; &lt;div class="commitment"&gt; &lt;p&gt;Alex 3:&lt;/p&gt; &lt;p&gt;He's works great.&lt;/p&gt; &lt;/div&gt; &lt;div class="commitment"&gt; &lt;p&gt;Alex 4:&lt;/p&gt; &lt;p&gt;He's works great.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I am I am clear. Thanks for any help :)</p>
    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.
 

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