Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML Show Less

Hello

We used to have the show more option which expanded the text field working on our site but it doesn't work, can you assist with recommendations?

[CODE lang="html" title="Show Less"]These occasions often morph into memories that we carry with us for years, of good times shared over good food, better company, and the best wine.
<a id="collapsible-article-toggle" href="#">Show More</a>
<div id="collapsible-article" style="height: auto;width: 100%;overflow: hidden;margin-bottom: 25px">

<h2>Create a New Mood in Your Dining Room with a Hamptons-Style Dining Set</h2>[/CODE]
 
Before you add the script, just tell me where is the closing div of id collapsible-article? Take screenshot and paste the image. Don't forget to mark the closing div tag.
 
Change your a tag and div with the code that I have posted before. Than paste the script below that closing div tag. If you will not call the function in your a tag than how will the script will work.
 
Change a tag and div to this -
HTML:
<a style="cursor: pointer" id="collapsible-article-toggle" onclick="myFunction()">Show More</a>
<div id="collapsible-article" style="display: none; height: auto;width: 100%;overflow: hidden;margin-bottom: 25px">
 
On your each update you are changing your code. Replace the below code and see if it works.
HTML:
<header class="woocommerce-products-header">
    <h1 class="woocommerce-products-header__title page-title">Dining</h1>
                
    <div class="term-description">
        <p><span class="teaser">LM Home Interiors Living range includes <a href="https://lmhomeinteriors.com.au/product-category/living/couches-and-sofas/">sofas</a>, <a href="https://lmhomeinteriors.com.au/product-category/living/armchairs-and-ottomans/">accent chairs</a>, <a href="https://lmhomeinteriors.com.au/product-category/living/side-tables/">side</a> and <a href="https://lmhomeinteriors.com.au/product-category/living/coffee-tables/">coffee tables</a>, <a href="https://lmhomeinteriors.com.au/product-category/living/entertainment-units/">media units</a>, <a href="https://lmhomeinteriors.com.au/product-category/living/cabinets-and-bookcases/">storage furniture</a>,
            ottomans and more. A Hamptons-style dining set is a perfect option for
            reimagining your home’s dining and entertaining space. There’s something
            timeless and laidback (yet simultaneously elegant) about a dinner with
            good friends or beloved family members. These occasions often morph into
            memories that we carry with us for years, of good times shared over
            good food, better company, and the best wine.</br>
            
            <a style="cursor: pointer" id="collapsible-article-toggle" onclick="myFunction()">Show More</a></span>
        </p>
        
        <div id="collapsible-article" style="display: none; height: auto;width: 100%;overflow: hidden;margin-bottom: 25px">
            <h2>Create a New Mood in Your Dining Room with a Hamptons-Style Dining Set</h2>
            <p>At LM Home Interiors, we dedicate ourselves to helping our customers
            find a dining set as timeless, laidback, and elegant as their favourite
            dinnertime memories. A Hamptons dining table and chairs is, in our
            opinion, the very best way to achieve this ambience.</p>
            <h2>Some Interesting Facts about Hamptons-Style DĂ©cor</h2>
            <p>What makes a Hampton-style dining table and chairs the ideal setup
            for your home dining room or kitchen? To answer that question, it’s
            important to understand what Hamptons style is. Here are some fun facts
            to explain:</p>
            <ul>
                <li><strong>Where is the Hamptons?</strong> The Hamptons is a group of
                villages in Long Island, New York. This area is known as a summertime
                escape for affluent individuals, many of them New York City residents
                who spend the warmer months at mansions on the beach. Fittingly,
                Hamptons-style décor is beachy, coastal, summery, and relaxed, yet also
                as luxurious as you would think a house in an affluent summer getaway
                would be.</li>
                <li><strong>Hamptons furniture often carries a light, bright or neutral colour palette.</strong>
                 At LM Home Interiors, our Hamptons-style dining sets are teak
                indoor-outdoor tables with wicker or linen chairs. Bright, neutral, and
                earthy tones such as white, brown, and grey reign supreme in Hamptons
                style—though navy and blue hues often add to the coastal, waterside
                feel.</li>
                <li><strong>It’s not just about the furniture.</strong> The right dining
                 set or living room furniture can anchor a Hamptons-style home, but the
                location and architecture of the house itself does a lot of the work,
                too. Coastal properties are a good fit for this style of décor, but just
                 as important is having a bright space with many windows and natural
                light or light timber floors and cabinetry.</li>
            </ul>
            <h3><strong>What You Can Expect from LM Home Interiors Regarding Your Hamptons-Style Dining Set</strong></h3>
            <p>When you shop with LM Home Interiors for your Hamptons dining table
            and chairs, you can expect us to go above and beyond to get the right
            look and feel for your dream dining room setup. This approach includes:</p>
            <ul>
                <li><strong>Carefully crafted furniture. </strong>Our pieces are not
                mass-produced or cheaply made. Everything we carry is carefully
                handcrafted and finished, to deliver the type of luxury atmosphere you’d
                 expect from a Hamptons house.</li>
                <li><strong>More than just the furniture. </strong>We’re here to help
                you create a cohesively-themed space. That process starts with the
                furniture itself, but it may also involve lamps and lighting, rugs,
                artwork, or other homewares. <a href="https://lmhomeinteriors.com.au/product-category/homewares/view-all-homewares/">Check out what we have to offer in this regard</a>.</li>
                <li><strong>Non-Hamptons prices. </strong>The Hamptons are known for
                their affluent residents, which means Hamptons-style décor is often
                equated with expense. We’ve gone to great lengths to keep our products
                priced fairly so that you can get that elegant look without the luxury
                price tag.</li>
            </ul>
            <h4><strong>About LM Home Interiors</strong></h4>
            <p>We got our start three years ago, intending to help our customers
            achieve everyday beautiful living. Since then, we’ve built a reputation
            for our gorgeous handmade pieces, our helpful customer service, and our
            dedication to helping our buyers create elegant themes for their spaces.
             If what you’re after is a Hamptons theme, then we’re with you every
            step of the way. Set your next share of dinnertime memories in the
            perfect space, with a Hampton-style dining table and chairs. <a href="https://lmhomeinteriors.com.au/get-in-touch/">Contact us today to get started</a>.</p>
        </div>
        <script>
            var show_button = document.getElementById("collapsible-article-toggle");
            var show_article = document.getElementById("collapsible-article");
            
            function myFunction() {
                if(show_article.style.display === "none"){
                    show_button.innerHTML = "Show Less";
                    show_article.style.display = "block";
                } else {
                    show_button.innerHTML = "Show More";
                    show_article.style.display = "none";
                }
            }
        </script>
    </div>           
</header>
 
I think there are some issues in the back end for the JS, I have reached out to a Website developer to see if they can fix behind the scene. I truly appreciate all your help and can not thank you enough for assisting. I will keep you updated.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom