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. Horizontal Scroll Gallery

Horizontal Scroll Gallery

Scheduled Pinned Locked Moved General Discussion
10 Posts 4 Posters 2.0k Views 2 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.
  • F
    F
    felix_rabe
    wrote on last edited by felix_rabe
    #1

    Hello Layteam,

    check this pen:
    https://codepen.io/LeCorbeau/pen/XWWbPzm

    Its a horizontal gallery that scrolls sidewards even when you scroll down/up on your mouse, so it works for people who use a mouse with a classic mousewheel.
    I wrote it exactly like that in laytheme, the layout looks fine but the scroll-modification doesnt work. its just a normal scroll so far. It seems i have to give the Galerie-Div a overflow property to make it scrollable in laytheme, but this seems to deactivate the scroll-fix in the codepen.

    Thank you very much for taking a look.
    Felix

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

      Dear @fr
      it will be some try and error to achieve this. Especially because the site needs to be structured horizontally.

      Read here:
      http://laytheme.com/documentation.html#custom-javascript

      Try on an empty Laytheme page and work your step forward little by little :-)

      Keep us updated!

      Best!

      Marius

      www.mariusjopen.world

      F 1 Reply Last reply
      0
      • F
        F
        felix_rabe
        wrote on last edited by
        #3

        Marius, thank you for your reply. I could not find a fix for that. But i have a nother issue on the same Layout.
        Please visit this sample page:

        https://www.stellaachenbach.com/radiolaria-2

        The Problem:
        When i scale the Window down to a mobile size, the width of my Images gets cropped to the device width. you can see this when you scroll sideways in the gallery. I think this might be some responsive-thing i cant get around so far? Thank you for taking a look into it again.

        Felix

        F 1 Reply Last reply
        0
        • F felix_rabe

          Marius, thank you for your reply. I could not find a fix for that. But i have a nother issue on the same Layout.
          Please visit this sample page:

          https://www.stellaachenbach.com/radiolaria-2

          The Problem:
          When i scale the Window down to a mobile size, the width of my Images gets cropped to the device width. you can see this when you scroll sideways in the gallery. I think this might be some responsive-thing i cant get around so far? Thank you for taking a look into it again.

          Felix

          F
          F
          felix_rabe
          wrote on last edited by
          #4

          Okay, i found a hidden "widht: 100%" that was attached to the img, so it’s fixed.

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

            Dear @fr
            ah great! Thank you for sharing!

            Best!

            Marius

            www.mariusjopen.world

            1 Reply Last reply
            0
            • mariusjopenM mariusjopen

              Dear @fr
              it will be some try and error to achieve this. Especially because the site needs to be structured horizontally.

              Read here:
              http://laytheme.com/documentation.html#custom-javascript

              Try on an empty Laytheme page and work your step forward little by little :-)

              Keep us updated!

              Best!

              Marius

              F
              F
              felix_rabe
              wrote on last edited by
              #6

              Hey @mariusjopen

              I fixed the issue with the horizontal arranged gallery that scrolls sideways when you use a vertical mousewheel. Here is a function that works with laytheme.
              it hast to be written directly into the custom html for the div.

              What also came in handy is to add »style="-webkit-transform: translateZ(0);"« inside every <img> tag. Because the mobile device has a bit of a difficulty to show images correctly when using » -webkit-overflow-scrolling: touch;« in a horizontal layout.

              Cheers
              Felix

              p.s. I don’t know how to use the »coding-look« with black background in this forum?

              <script>jQuery(function () {
              jQuery.fn.hScroll = function (amount) {
              amount = amount || 120;
              jQuery(this).bind("DOMMouseScroll mousewheel", function (event) {
              var oEvent = event.originalEvent,
              direction = oEvent.detail ? oEvent.detail * -amount : oEvent.wheelDelta,
              position = jQuery(this).scrollLeft();
              position += direction > 0 ? -amount : amount;
              jQuery(this).scrollLeft(position);
              event.preventDefault();
              })
              };
              });

              jQuery(document).ready(function() {
              jQuery('.div').hScroll(30); // You can pass (optionally) scrolling amount
              });
              </script>

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

                hey man!

                all of this can be a little difficult to achieve, good luck with that!
                i won't do support for this, cause this is too much custom functionality, better hire a developer for this

                1 Reply Last reply
                0
                • F
                  F
                  felix_rabe
                  wrote on last edited by
                  #8

                  hey @arminunruh,

                  read the last post again, it works ;-)

                  1 Reply Last reply
                  0
                  • daniD
                    daniD
                    dani
                    wrote on last edited by
                    #9

                    @felix_rabe said in Horizontal Scroll Gallery:

                    <script>jQuery(function () {
                    jQuery.fn.hScroll = function (amount) {
                    amount = amount || 120;
                    jQuery(this).bind("DOMMouseScroll mousewheel", function (event) {
                    var oEvent = event.originalEvent,
                    direction = oEvent.detail ? oEvent.detail * -amount : oEvent.wheelDelta,
                    position = jQuery(this).scrollLeft();
                    position += direction > 0 ? -amount : amount;
                    jQuery(this).scrollLeft(position);
                    event.preventDefault();
                    })
                    };
                    });
                    jQuery(document).ready(function() {
                    jQuery('.div').hScroll(30); // You can pass (optionally) scrolling amount
                    });
                    </script>

                    Hey Felix,

                    Can you show the working code (HTML)?

                    Thanks!

                    https://danielcampbell.ca

                    1 Reply Last reply
                    0
                    • F
                      F
                      felix_rabe
                      wrote on last edited by
                      #10

                      pen with the code:
                      https://codepen.io/LeCorbeau/pen/YzVmKWv

                      1 Reply Last reply
                      1

                      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
                      Y
                      yaninaisla
                      OLVVDBO
                      OLVVDB
                      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