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. Accordeon-feature or plugin?

Accordeon-feature or plugin?

Scheduled Pinned Locked Moved General Discussion
5 Posts 3 Posters 187 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.
  • B Offline
    B Offline
    bbbfg
    wrote on May 12, 2022, 8:06 AM last edited by
    #1

    Hello! :)

    Is there a possibility to add a "more" area to a text module, i.e. an "accordion"?
    (the text is separated at a certain point and when you click on "more", an area with the entire text opens).

    Thanks!

    1 Reply Last reply
    1
    • R Offline
      R Offline
      Richard
      Global Moderator
      wrote on May 12, 2022, 11:57 PM last edited by
      #2

      Dear @bbbfg

      Currently not without coding an accordion - there are threads on this forum where users have done that and also simple ones online that you could implement.

      This is a great idea though and will happily add to the development notes 🌝


      Best wishes
      Richard
      1 Reply Last reply
      1
      • D Offline
        D Offline
        dani
        wrote on May 16, 2022, 3:19 AM last edited by
        #3

        try this:

        HTML

        <div class="more">Click here for more info</div>
        <div class="less">Here is the hidden content</div>
        

        Use <div> instead of <p>, so that you can use <p> within the hidden content.

        CSS

        /* open close dots - see JS */
        .more:hover:after { 
            content: " ○○○";
        }
        .more:after {
            content: " ●●●";
        }
        .less { 
          display:none; 
        }
        

        JS

        <script>
        window.laytheme.on("newpageshown", function(layoutObj, type, obj){
            
        /* open close dots */  
            jQuery('.more').click(function(){
                jQuery(this).next().slideToggle();
                jQuery('.less').not(jQuery(this).next()).slideUp();
            });
          
        });
        </script>
        

        https://danielcampbell.ca

        D 1 Reply Last reply May 16, 2022, 3:21 AM
        1
        • D dani
          May 16, 2022, 3:19 AM

          try this:

          HTML

          <div class="more">Click here for more info</div>
          <div class="less">Here is the hidden content</div>
          

          Use <div> instead of <p>, so that you can use <p> within the hidden content.

          CSS

          /* open close dots - see JS */
          .more:hover:after { 
              content: " ○○○";
          }
          .more:after {
              content: " ●●●";
          }
          .less { 
            display:none; 
          }
          

          JS

          <script>
          window.laytheme.on("newpageshown", function(layoutObj, type, obj){
              
          /* open close dots */  
              jQuery('.more').click(function(){
                  jQuery(this).next().slideToggle();
                  jQuery('.less').not(jQuery(this).next()).slideUp();
              });
            
          });
          </script>
          
          D Offline
          D Offline
          dani
          wrote on May 16, 2022, 3:21 AM last edited by
          #4

          @dani example:
          http://66.199.141.101/~dbvincze/works/

          https://danielcampbell.ca

          1 Reply Last reply
          1
          • B Offline
            B Offline
            bbbfg
            wrote on May 16, 2022, 6:54 AM last edited by
            #5

            Tank you!

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

            1/5

            May 12, 2022, 8:06 AM


            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
            benjaminmugnierB
            benjaminmugnier
            less than a minute ago
            reinterpretR
            reinterpret
            9 minutes ago
            S
            Stanlouche
            12 minutes ago
            A
            alasdair17
            18 minutes ago
            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.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Recent
            • Tags
            • Popular
            • Users
            • Search