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. Accordion: disable content jumping

Accordion: disable content jumping

Scheduled Pinned Locked Moved General Discussion
11 Posts 3 Posters 77 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.
  • arminunruhA Offline
    arminunruhA Offline
    arminunruh
    Global Moderator
    wrote on last edited by
    #2

    hello!

    you could try this Enter this css in "lay options" -> "custom css & html" -> "custom css for desktop":

    .accordion-content{
    position: absolute;
    }

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dennisbern
      wrote on last edited by dennisbern
      #3

      Awesome. Works perfectly! Thanks a lot!

      A 1 Reply Last reply
      0
      • D dennisbern

        Awesome. Works perfectly! Thanks a lot!

        A Offline
        A Offline
        alasdair17
        wrote on last edited by
        #4

        @dennisbern hey, I really like the way you have setup an accordion, is this via a plugin or custom code? It works really smoothly.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dennisbern
          wrote on last edited by dennisbern
          #5

          This is a custom code. Which I actually found in this forum. I think it was a code from @arminunruh

          I put it in an edit html box:

          <div class="accordion">
          <div class="accordion-title _accordion_title">
          <span>Title</span>
          <span class="plus">+</span>
          <span class="minus">-</span>
          </div>
          <div class="accordion-content _accordeon_laufschrift">
          <p>TEXT
          </div>
          </div>

          1 Reply Last reply
          1
          • D Offline
            D Offline
            dennisbern
            wrote on last edited by dennisbern
            #6

            Hey a question about my code :)

            I have blue links (desktop version) in my accordion. where can I edit them so that they are black?

            Another thing: I want the links to open in a separate tab or window. How can I do that with the HTML code?

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

              Links need to have a target blank attribute for them to be opened in a new tab.

              target="_blank"

              <a href="…" target="_blank">asd</a>

              Blue links to black is just CSS.

              .accordion a{
              color: black!important;
              }

              D 1 Reply Last reply
              1
              • arminunruhA Offline
                arminunruhA Offline
                arminunruh
                Global Moderator
                wrote on last edited by
                #8

                Thanks for providing the code for @alasdair17 , but I think it's missing the JavaScript part.

                D A 2 Replies Last reply
                0
                • arminunruhA arminunruh

                  Thanks for providing the code for @alasdair17 , but I think it's missing the JavaScript part.

                  D Offline
                  D Offline
                  dennisbern
                  wrote on last edited by
                  #9

                  @arminunruh True:

                  <script>
                  window.laytheme.on('newpageshown', function(){
                  jQuery(".accordion-title").on("click", function(){
                  jQuery(this.parentNode).toggleClass("active")
                  })
                  })
                  </script>
                  <style>
                  .accordion-title{
                  cursor: pointer;
                  }
                  .accordion .minus, .accordion .plus{
                  margin-left: 30px;
                  }
                  .accordion .minus{
                  display: none;
                  }
                  .accordion .accordion-content{
                  display: none;
                  margin-top: 20px;
                  }
                  .accordion.active .minus{
                  display: inline;
                  }
                  .accordion.active .plus{
                  display: none;
                  }
                  .accordion.active .accordion-content{
                  display: block;
                  }
                  .accordion-title{
                  display: inline-block;
                  }
                  </style>

                  1 Reply Last reply
                  1
                  • arminunruhA arminunruh

                    Links need to have a target blank attribute for them to be opened in a new tab.

                    target="_blank"

                    <a href="…" target="_blank">asd</a>

                    Blue links to black is just CSS.

                    .accordion a{
                    color: black!important;
                    }

                    D Offline
                    D Offline
                    dennisbern
                    wrote on last edited by
                    #10

                    @arminunruh Thanks a lot. Works also perfect!

                    1 Reply Last reply
                    1
                    • arminunruhA arminunruh

                      Thanks for providing the code for @alasdair17 , but I think it's missing the JavaScript part.

                      A Offline
                      A Offline
                      alasdair17
                      wrote on last edited by
                      #11

                      @arminunruh @dennisbern cheers!

                      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