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.
I have the following fiddle: http://jsfiddle.net/mauricederegt/vNpYe/5/
With the following HTML:
<div id="main" tabindex="1"> <div class="tile tile1" block-id="1" style-id="1" style="left:0px; top:0px"></div> <div class="tile tile3" block-id="2" style-id="2" style="left:100px; top:0px"></div> <div class="tile tile1" block-id="3" style-id="1" style="left:200px; top:0px"></div> <div class="tile tile2" block-id="4" style-id="2" style="left:350px; top:0px"></div> <div class="tile tile2" block-id="5" style-id="2" style="left:0px; top:100px"></div> <div class="tile tile1" block-id="6" style-id="1" style="left:100px; top:100px"></div> </div> I am trying to randomize the order off the div's class. So just the class part: class="tile tile1", all other items of the div should remain as is.
Example: The code could look like this after randomizing (note that only the class is shuffled):
<div id="main" tabindex="1"> <div class="tile tile3" block-id="1" style-id="1" style="left:0px; top:0px"></div> <div class="tile tile2" block-id="2" style-id="2" style="left:100px; top:0px"></div> <div class="tile tile1" block-id="3" style-id="1" style="left:200px; top:0px"></div> <div class="tile tile2" block-id="4" style-id="2" style="left:350px; top:0px"></div> <div class="tile tile1" block-id="5" style-id="2" style="left:0px; top:100px"></div> <div class="tile tile1" block-id="6" style-id="1" style="left:100px; top:100px"></div> </div> How can I get the div's classes to display in a random order?
Hope the question is more clear now.
Many thanks
shuffle styleeven means, or what a layer or level means in context of demo. Demo's should be scaled down to present only enough code to present an issue, not be a whole application. Surely you can remove most of the rendering code and replace with static html, with only enough script to deal with whatever it is you are trying to doshuffle, source of these classes etc. Explanation is just not clear at all. Disagree all you want but until you can provide simplest demo needed to present issue only, with irrelevant code removed, and a well constructed explanation, doubt you will find much assistance