D5 Creation Forum

Open Forum for D5 Creation's Members and Visitors

Before requesting any support Please search the Forum First. You may find your desired answer. This will save your waiting time and will save our working hour. We may not answer the question which we have already answered. You should also read our Support Policy

Reply To: Random Order of HTML Elements

Front Page D5 Creation Forum General Support Random Order of HTML Elements Reply To: Random Order of HTML Elements

#11495
Karsten Zilling
Participant

Thanks for the feedback. Unfortunately it doesn’t seem to work! I used the script exactly as described! The images in the slider are still displayed in the same order. Above the script, I only have a style specification for the head area. This is what the content of my field looks like:

<style>
body { min-width: 930px !important; }
.box90 { width: 930px !important; }
</style>   

<script type=”text/javascript”>
jQuery.fn.randomize = function(selector){
  var jQueryelems = selector ? jQuery(this).find(selector) : jQuery(this).children(),
  jQueryparents = jQueryelems.parent(); jQueryparents.each(function(){
    jQuery(this).children(selector).sort(function(){
       return Math.round(Math.random()) – 0.5;
    }).detach().appendTo(this);  
}); return this;
};
jQuery(document).ready(function() {  
jQuery(‘.slides-container’).randomize(‘li’); });
</script>