• Resolved jazzu

    (@jazzu)


    Hello!

    I added an icon that’s supposed to show / hide a section below them. It works, however I want the icon to spin around for 180°, but it doesn’t.
    Why is that?

    The HTML I added:

    <script>
    document.addEventListener('DOMContentLoaded', function() {
    jQuery(function($){
    $('.showme').click(function(){
    $(this).closest('.elementor-section').next().slideToggle();
    $(this).toggleClass('opened');
    });
    $('.closebutton').click(function(){
    $(this).closest('.elementor-section').prev().find('.showme').click();
    });
    });
    });
    </script>
    <style>
    .showme a, .showme svg, .showme i , .showme img, .closebutton a, .closebutton i, .closebutton img{
            cursor: pointer;
            -webkit-transition: transform 0.34s ease;
    transition : transform 0.34s ease;
        }
    .opened i , .opened img,.opened svg{
            transform: rotate(180deg);
        }
    </style>
    

    After that, I just added the icon above the section that I want to show and gave it “showme” tag in CSS Classes.

    Thank you for your time

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

Viewing 1 replies (of 1 total)
  • Thread Starter jazzu

    (@jazzu)

    Added the .showme div.elementor-icon and .opened div.elementor-icon and it works now.
    Code:

    <style>
    .showme a, .showme svg, .showme i, .showme img, .showme div.elementor-icon, .closebutton a, .closebutton i, .closebutton img, .closebutton div.elementor-icon,{
            cursor: pointer;
            -webkit-transition: transform 0.34s ease;
    transition : transform 0.34s ease;
        }
    .opened i, .opened img,.opened svg, .opened div.elementor-icon{
        transform: rotate(180deg);
        }
    </style>
Viewing 1 replies (of 1 total)
  • The topic ‘Click to show section button / icon elementor’ is closed to new replies.