Note that there are some explanatory texts on larger screens.

plurals
  1. PORandom div class order
    primarykey
    data
    text
    <p>As suggested by many, I have taken their advice and reformed my question. I took out a lot of code and have now the bare minimum shown. Hope this is sufficient and clear enough to re-open my question.</p> <p>I have the following fiddle: <a href="http://jsfiddle.net/mauricederegt/vNpYe/5/" rel="nofollow">http://jsfiddle.net/mauricederegt/vNpYe/5/</a></p> <p>With the following HTML:</p> <pre><code>&lt;div id="main" tabindex="1"&gt; &lt;div class="tile tile1" block-id="1" style-id="1" style="left:0px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile3" block-id="2" style-id="2" style="left:100px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile1" block-id="3" style-id="1" style="left:200px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile2" block-id="4" style-id="2" style="left:350px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile2" block-id="5" style-id="2" style="left:0px; top:100px"&gt;&lt;/div&gt; &lt;div class="tile tile1" block-id="6" style-id="1" style="left:100px; top:100px"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I am trying to randomize the order off the div's class. So just the <code>class</code> part: <code>class="tile tile1"</code>, all other items of the div should remain as is.</p> <p>Example: The code could look like this after randomizing (note that only the <code>class</code> is shuffled):</p> <pre><code>&lt;div id="main" tabindex="1"&gt; &lt;div class="tile tile3" block-id="1" style-id="1" style="left:0px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile2" block-id="2" style-id="2" style="left:100px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile1" block-id="3" style-id="1" style="left:200px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile2" block-id="4" style-id="2" style="left:350px; top:0px"&gt;&lt;/div&gt; &lt;div class="tile tile1" block-id="5" style-id="2" style="left:0px; top:100px"&gt;&lt;/div&gt; &lt;div class="tile tile1" block-id="6" style-id="1" style="left:100px; top:100px"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>​How can I get the div's classes to display in a random order?</p> <p>Hope the question is more clear now.</p> <p>Many thanks</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.
 

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