Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Randomize thumbnails order in Thumbnail grid

Randomize thumbnails order in Thumbnail grid

Scheduled Pinned Locked Moved General Discussion
9 Posts 6 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    J
    jspinkus
    wrote on last edited by
    #1

    Hi @mariusjopen
    Hope your doing fine in this times of pandemia and isolation.

    Im trying to randomize the order in my projects Thumbnail grid:
    https://www.chamberprojects.com/category/images

    This are the codes I tried, I know they work becuase i tried them in a jsfiddle, but for some reason they are not working in the grid, maybe you can give me a hint:

    <script>
    jQuery(function () {
    var parent = jQuery(".thumb-collection");
    var divs = parent.children();
    while (divs.length) {
    parent.append(divs.splice(Math.floor(Math.random() * divs.length), 1)[0]);
    }
    });
    </script>

    OR:

    <script>
    jQuery(".thumb-collection").php(jQuery(".thumb-collection .thumbnail-wrap").sort(function(){
    return Math.random()-0.5;
    }));
    </script>

    Thank you!

    1 Reply Last reply
    0
    • mariusjopenM
      mariusjopenM
      mariusjopen
      Global Moderator
      wrote on last edited by mariusjopen
      #2

      Dear @juanpinkus
      This is a great idea and we will write it down for the future. Right now this is not possible.

      Does this code work on JSfiddle?

      Thank you!
      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • J
        J
        jspinkus
        wrote on last edited by
        #3

        Hi @mariusjopen

        Thanks for answering. Yes, this codes work on JSfiddle

        Here are both examples:
        https://jsfiddle.net/epxwy3tz/
        http://jsfiddle.net/axphy0gv/

        I can't figure out why is not woriking on Laytheme, I tried changing the postition of .thumbnial-wrap to "position: static", and add "float: left", but still not working.

        I'm missing something and I dont know what it is.

        Thank you!
        Juan

        1 Reply Last reply
        0
        • arminunruhA
          arminunruhA
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          its not possible sorry

          F 1 Reply Last reply
          0
          • arminunruhA arminunruh

            its not possible sorry

            F
            F
            Financial
            wrote on last edited by
            #5

            @arminunruh any update on this functionality? I'm reviving an old post because I think it's better than making a new one just to ask this question. Please remove if against the rules.

            1 Reply Last reply
            0
            • RichardR
              RichardR
              Richard
              Global Moderator
              wrote on last edited by
              #6

              Dear @Financial

              No need to remove this post, happy to talk on older threads 🌝
              Randomizing the order of the Thumbnail grid is still not a built in option and will need to be custom coded.


              Best
              Richard
              1 Reply Last reply
              0
              • F
                F
                Financial
                wrote on last edited by Financial
                #7

                thanks for the reply! any advice on how one would go about custom coding it? is it merely a css issue or...?

                1 Reply Last reply
                0
                • edgrbnzE
                  edgrbnzE
                  edgrbnz
                  wrote on last edited by
                  #8

                  +1

                  for this feature!

                  ✦ ✦ ✦

                  1 Reply Last reply
                  0
                  • RichardR
                    RichardR
                    Richard
                    Global Moderator
                    wrote on last edited by
                    #9

                    Dear @edgrbnz @Financial

                    Have added to the development noted & forwarded to Armin 🌝


                    Best
                    Richard
                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    Online Users
                    L
                    lstark
                    Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                    laytheme.com
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Search