0

I want shuffling

<ul class="abc">
    <li class="xyz">1</li>
    <li class="xyz">2</li>
    <li class="xyz">3</li>
    <li class="xyz">4</li>
    <li class="xyz">5</li>
    <li class="xyz">6</li>
    <li class="xyz">7</li>
    <li class="xyz">8</li>
    <li class="xyz">9</li>
    <li class="xyz">10</li>
</ul>

I want shuffling like when i refresh first time on UI shows 6,7,8,9,10 or in any order but dont show first 1,2,3,4,5 these shows below the first items. next time when refresh page it shows again 1,2,3,4,5 and now 6,7,8,9,10 under these first list items. i used math.random() function but it not properly work it exchange only 2 or 3 list items. i want a group (1 to 5) exchange positions with 6 to 10 andd again 6 to 10 with 1 to 5 and so on I am also using infinite scroll lazy loading in my website

Satpal
  • 132,252
  • 13
  • 159
  • 168
  • show us the 'refresh function' Also you might just check out http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array – A. L Feb 03 '17 at 09:04
  • Share your code what you have tried for this implementation – Manoj Feb 03 '17 at 09:13
  • I have list of 100 products. in this list there is image, title, price etc. render dynamically from database in shopify. now in front view on home page i render this list. so first time first 5 list items(products) shown. my requirement is when i refresh the page next time new 5 items shown from list.i dont want any item from previous 5. like wish.com – Deftsoft Dotnet Feb 03 '17 at 09:54

0 Answers0