fbpx

Reply To: How to add “More button” in long texts

HomeSupport forumHow to add “More button” in long textsReply To: How to add “More button” in long texts
#13850
Artem Temos
Artem Temos
Keymaster

Hello @seyitacar30,

You need to use HTML element (http://prntscr.com/zpdm7a) and paste the code we gave below into it (http://prntscr.com/zpdo0n).

<div class="xts-read-more-text">
    <div class="elementor-widget-container">
        <div class="xts-page-text">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
        <a class="xts-read-more-btn" href="#read-more">More</a>
    </div>
</div>
<script>
jQuery(document).ready(function(){jQuery(".xts-read-more-text").on("click",".xts-read-more-btn",function(e){e.preventDefault();var t=jQuery(this),a=t.parents(".xts-read-more-text");a.hasClass("xts-text-expand")?(a.removeClass("xts-text-expand"),t.text("More")):(a.addClass("xts-text-expand"),t.text("Hide details"))})});
</script>
<style>.xts-read-more-text .elementor-widget-container{position:relative}.xts-read-more-text .xts-page-text{overflow:hidden;height:160px}.xts-read-more-text>.elementor-container{overflow:hidden;height:600px}.xts-read-more-text .title,.xts-read-more-text h1,.xts-read-more-text h2,.xts-read-more-text h3{font-size:28px}.xts-read-more-text .xts-read-more-btn{position:absolute;top:calc(100% + 10px);left:0;font-size:14px;line-height:1.1;padding:0 0 3px 0;min-height:auto;height:auto!important;border-radius:0;background-color:transparent!important;box-shadow:none!important;font-weight:600;color:#333}.xts-read-more-text .xts-read-more-btn:after,.xts-read-more-text .xts-read-more-btn:before{content:"";position:absolute;top:calc(100% - 2px);right:0;left:0;border-bottom:2px solid}.xts-read-more-text .xts-read-more-btn:after{margin:0 auto;width:0;transition:width .6s cubic-bezier(.19,1,.22,1)}.xts-read-more-text .xts-read-more-btn:hover:after{width:100%}.xts-read-more-text .xts-read-more-btn:before{opacity:.3}.xts-read-more-text .xts-read-more-btn:hover{color:#333}.xts-read-more-text:not(.xts-text-expand) .xts-page-text,.xts-read-more-text:not(.xts-text-expand)>.elementor-container{mask-image:linear-gradient(to top,transparent 0,#000 50px);-webkit-mask-image:linear-gradient(to top,transparent 0,#000 50px)}.xts-read-more-text.xts-text-expand .xts-page-text,.xts-read-more-text.xts-text-expand>.elementor-container{height:auto}</style>

Regards

Sign in

No account yet?

Create an Account