"Read more"-Button
-
wrote on May 4, 2018, 11:48 AM last edited by
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.
-
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
-
wrote on May 4, 2018, 2:19 PM last edited by
@mariusjopen said in "Read more"-Button:
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. -
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
-
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
wrote on Jan 27, 2022, 9:43 AM last edited by@mariusjopen
Is there a fixed link?
I want to do the same, but the link is broken?!
thx :) -
wrote on Jan 28, 2022, 12:30 PM last edited by
@dingdong Have a look at what I made before, it might work for you.
http://laythemeforum.com:4567/topic/4896/accordion-bug/23?_=1643372835433
-
@dingdong Have a look at what I made before, it might work for you.
http://laythemeforum.com:4567/topic/4896/accordion-bug/23?_=1643372835433
wrote on Jan 28, 2022, 4:34 PM last edited by@Remco-van-Dun THX!!!
worked perfect for me, just had to change
"panel.style.maxHeight" into more than 200px :D
I also code custom websites or custom Lay features.
💿 Email me here: 💿
info@laytheme.com
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- 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:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it