Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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 910 Views
  • 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 Offline
    F Offline
    felix_rabe
    wrote on Oct 11, 2019, 10:20 AM last edited by felix_rabe Oct 11, 2019, 6:54 AM
    #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
    • M Offline
      M Offline
      mariusjopen
      Global Moderator
      wrote on Oct 14, 2019, 1:42 PM 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 Nov 25, 2019, 3:57 PM
      0
      • F Offline
        F Offline
        felix_rabe
        wrote on Nov 11, 2019, 10:07 AM 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 Nov 11, 2019, 10:45 AM
        0
        • F felix_rabe
          Nov 11, 2019, 10:07 AM

          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 Offline
          F Offline
          felix_rabe
          wrote on Nov 11, 2019, 10:45 AM 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
          • M Offline
            M Offline
            mariusjopen
            Global Moderator
            wrote on Nov 12, 2019, 7:39 AM last edited by
            #5

            Dear @fr
            ah great! Thank you for sharing!

            Best!

            Marius

            www.mariusjopen.world

            1 Reply Last reply
            0
            • M mariusjopen
              Oct 14, 2019, 1:42 PM

              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 Offline
              F Offline
              felix_rabe
              wrote on Nov 25, 2019, 3:57 PM 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 Offline
                arminunruhA Offline
                arminunruh
                Global Moderator
                wrote on Nov 27, 2019, 2:11 PM 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 Offline
                  F Offline
                  felix_rabe
                  wrote on Nov 27, 2019, 2:33 PM last edited by
                  #8

                  hey @arminunruh,

                  read the last post again, it works ;-)

                  1 Reply Last reply
                  0
                  • daniD Offline
                    daniD Offline
                    dani
                    wrote on Aug 19, 2021, 2:53 AM 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 Offline
                      F Offline
                      felix_rabe
                      wrote on Aug 19, 2021, 11:01 AM last edited by
                      #10

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

                      1 Reply Last reply
                      1
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      I also code custom websites or custom Lay features.
                      💿 Email me here: 💿
                      info@laytheme.com

                      Before you post:
                      1. When using a WordPress Cache plugin, disable it or clear your cache.
                      2. Update Lay Theme and all Lay Theme Addons
                      3. Disable all Plugins
                      4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                      This often solves issues you might run into

                      When you post:
                      1. Post a link to where the problem is
                      2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                      3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                      Online Users
                      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