• I’ve been trying to figure out how to create a dropdown button that is placed within a page’s content where each sub-item is a clickable link and have been banging my head because nothing is working. I can’t seem to get it.

    Example:

    [ORDER]
    – AMAZON
    – BARNES & NOBLE
    – TARGET

    Here’s an example in actual use. Click on the “Buy The Book” button on this site .

    How can I create a button like this one on Brene’s site?

    • This topic was modified 3 years, 3 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @littleeasy its created by using js. So the main concept is: it is adding class “show” to the class “purchase-options__dropdown” when there is a click on the div having class “purchase-options”.

    Attaching the video link for detailed explaination for creating the dropdown.
    link: https://www.loom.com/share/d5dba0c265fd4fb28b9419817e1e3d25

    Now i am showing you the basic example to use add class function in js.

    <script>
    function myFunction() {
       var element = document.getElementById("myDIV");
       element.classList.add("mystyle");
    }
    </script>

    call this function on click.

    Thank you.

    Thread Starter littleeasy

    (@littleeasy)

    Thank you, Smit. I truly appreciate the help and the time you took to create the video. I’ve been looking at and trying but come to a point where I can’t get it. I may have to bring in someone to do it for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Create a Dropdown Button to put in a page’ is closed to new replies.