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. invert carousel slide direction

invert carousel slide direction

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 1.4k 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.
  • B
    B
    Blurred00
    wrote on last edited by
    #1

    Is possible invert the slide direction from left to right?

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

      no its not possible

      why do u need that?

      B 1 Reply Last reply
      0
      • arminunruhA arminunruh

        no its not possible

        why do u need that?

        B
        B
        Blurred00
        wrote on last edited by Blurred00
        #3

        @arminunruh
        Screenshot 2023-07-18 alle 09.36.20.png

        because i ve two section that are parallel. it show the same layout but different info content.
        The slide go to left and the result isn't good. Would be cool that it slide at the and respect the parallel design

        K 1 Reply Last reply
        0
        • B Blurred00

          @arminunruh
          Screenshot 2023-07-18 alle 09.36.20.png

          because i ve two section that are parallel. it show the same layout but different info content.
          The slide go to left and the result isn't good. Would be cool that it slide at the and respect the parallel design

          K
          K
          kalamakumaran
          wrote on last edited by kalamakumaran
          #4

          @Blurred00 @arminunruh

          Give the carousel you want to invert the class "reverse"

          Add this to your Custom JS

          <script>
          window.laytheme.on("newpageshown", function(){
          // Get the swiper-container element 
          var swiperContainer = document.querySelector('.swiper-container');
          
          // Check if the element exists and has the "reverse" class
          if (swiperContainer && swiperContainer.classList.contains('reverse')) {
            // Add the dir="rtl" attribute
            swiperContainer.setAttribute('dir', 'rtl');
          }
             });
          </script>
          

          and it should work!

          But apparently it seems to be not possible to add classes to carousels. Is it a bug @arminunruh ?

          Because when I remove the if statement out of the code it affects the .swiper-container and it inverts the direction.

          B 1 Reply Last reply
          1
          • K kalamakumaran

            @Blurred00 @arminunruh

            Give the carousel you want to invert the class "reverse"

            Add this to your Custom JS

            <script>
            window.laytheme.on("newpageshown", function(){
            // Get the swiper-container element 
            var swiperContainer = document.querySelector('.swiper-container');
            
            // Check if the element exists and has the "reverse" class
            if (swiperContainer && swiperContainer.classList.contains('reverse')) {
              // Add the dir="rtl" attribute
              swiperContainer.setAttribute('dir', 'rtl');
            }
               });
            </script>
            

            and it should work!

            But apparently it seems to be not possible to add classes to carousels. Is it a bug @arminunruh ?

            Because when I remove the if statement out of the code it affects the .swiper-container and it inverts the direction.

            B
            B
            Blurred00
            wrote on last edited by
            #5

            @kalamakumaran said in invert carousel slide direction:

            @Blurred00 @arminunruh

            Give the carousel you want to invert the class "reverse"

            Add this to your Custom JS

            <script>
            window.laytheme.on("newpageshown", function(){
            // Get the swiper-container element 
            var swiperContainer = document.querySelector('.swiper-container');
            
            // Check if the element exists and has the "reverse" class
            if (swiperContainer && swiperContainer.classList.contains('reverse')) {
              // Add the dir="rtl" attribute
              swiperContainer.setAttribute('dir', 'rtl');
            }
               });
            </script>
            

            and it should work!

            But apparently it seems to be not possible to add classes to carousels. Is it a bug @arminunruh ?

            Because when I remove the if statement out of the code it affects the .swiper-container and it inverts the direction.

            i ve added it to the custom css tab but don't work. Otherwise i think that it apply this rule to all slide, right?

            The problem is that i want apply it only in one slide.

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

              @kalamakumaran said in invert carousel slide direction:

              <script>
              window.laytheme.on("newpageshown", function(){
              // Get the swiper-container element
              var swiperContainer = document.querySelector('.swiper-container');

              // Check if the element exists and has the "reverse" class
              if (swiperContainer && swiperContainer.classList.contains('reverse')) {
              // Add the dir="rtl" attribute
              swiperContainer.setAttribute('dir', 'rtl');
              }
              });
              </script>

              <script>
              window.laytheme.on("newpageshown", function(){
              // Get the swiper-container element 
              var $reverse = jQuery('.reverse');
              
              if ($reverse.length > 0) {
                // Add the dir="rtl" attribute
                $reverse.find('.swiper-container').attr('dir', 'rtl');
              }
                 });
              </script>
              

              maybe like this?

              this needs to go into custom <head> content or custom html content. not custom css :D

              But apparently it seems to be not possible to add classes to carousels. Is it a bug @arminunruh ?

              i think this line of code doesnt work:
              swiperContainer.classList.contains('reverse')

              because .swiper-container is a child of .reverse

              because the reverse class is added to .col

              1 Reply Last reply
              0
              • B
                B
                Blurred00
                wrote on last edited by
                #7

                Hey i m really sorry for the late late late late reply. but it works!! thank you so much

                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
                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