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. "Read more"-Button

"Read more"-Button

Scheduled Pinned Locked Moved General Discussion
7 Posts 4 Posters 1.6k 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.
  • L Offline
    L Offline
    lars
    wrote on last edited by
    #1

    I’d like to implement a Read more button underneath my text block to expand and collapse it.

    I read the following forum post but unfortunately the codepen is no longer available and I couldn’t get it to work after inspecting the original posters website.

    I would like to know which content blocks need to be assigned the classes mentioned in the javascript.

    Re: "Read more" button

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

      Dear @lars

      this is an accordeon thing you need top code yourself.
      There is nothing by LayTheme preinstalled.

      Have a look at this fiddle:
      https://jsfiddle.net/mariusjopen/r63w9jfg/

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lars
        wrote on last edited by
        #3

        @mariusjopen said in "Read more"-Button:

        https://jsfiddle.net/mariusjopen/r63w9jfg/

        Dear Marius,

        thank you very much, thats exactly what I wanted!

        I put the the javascript in the header section as well as the css in the custom css section.
        For the HTML I tried both the +HTML block as well as a +Text block. Unfortunately neither of them are working at the moment.

        https://larswinter.me/wordpress

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

          Dear @lars
          did you have a look here?

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

          Because your Lay Theme website is a "Single Page" JavaScript application you cannot just use jQuery(document).ready(…) to execute your js because the ready event only fires once when the website loads the first time.

          Best!

          Marius

          www.mariusjopen.world

          D 1 Reply Last reply
          0
          • mariusjopenM mariusjopen

            Dear @lars
            did you have a look here?

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

            Because your Lay Theme website is a "Single Page" JavaScript application you cannot just use jQuery(document).ready(…) to execute your js because the ready event only fires once when the website loads the first time.

            Best!

            Marius

            D Offline
            D Offline
            dingdong
            wrote on last edited by
            #5

            @mariusjopen
            Is there a fixed link?
            I want to do the same, but the link is broken?!
            thx :)

            1 Reply Last reply
            0
            • R Offline
              R Offline
              Remco van Dun
              wrote on last edited by
              #6

              @dingdong Have a look at what I made before, it might work for you.

              http://laythemeforum.com:4567/topic/4896/accordion-bug/23?_=1643372835433

              Test:
              https://remcovandun.nl/home/accordeon/

              D 1 Reply Last reply
              0
              • R Remco van Dun

                @dingdong Have a look at what I made before, it might work for you.

                http://laythemeforum.com:4567/topic/4896/accordion-bug/23?_=1643372835433

                Test:
                https://remcovandun.nl/home/accordeon/

                D Offline
                D Offline
                dingdong
                wrote on last edited by
                #7

                @Remco-van-Dun THX!!!
                worked perfect for me, just had to change
                "panel.style.maxHeight" into more than 200px :D

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