Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1280504

    Hey folks,
    I checked several toggle solutions (also the one under your docs https://kriesi.at/documentation/enfold/button/#toggle-id-7), but got none of them to work out of the box.I think it has something to do with jQuery or the color section, because I get an easier toggle option (Div toggle – https://jsfiddle.net/p5wkvrj9/) to work when using code block + jQuery directly from Google, even though the same jQuery 3.5.1 was already loaded with Enfold.

    Still, with the jQuery on board I can’t get it to work, nothing happens when I click the button.

    – newest Enfold
    – same result with deactivated cache plugin
    – jQuery migrated deactivated

    Any hints?

    • This topic was modified 3 years, 8 months ago by Ismael.
    #1281291

    Hey mc_wa,

    Could you post a link to where we can see the problem you are having?

    Best regards,
    Rikard

    #1281361

    Thanks for your reply, posted the link in privat area.

    #1281928

    Hi,

    Thanks for that. I’m seeing jQuery error messages coming from the file in private, what happens if you disable that plugin?

    Best regards,
    Rikard

    #1282839

    Hi Rikard,

    thanks for your reply. Disabling the plugin didn’t yield other results. Still no luck with toggling.

    #1283671

    Hi,

    Thank you for the update.

    Instead of using the window.load function, try to use the following instead.

    $(document).ready(function(){
       // code here
    }):
    

    It might not be working because window.load is already deprecated or invalid.

    Best regards,
    Ismael

    #1283826

    Thanks Ismael, this helped, but with the “easy code”, not the one from Enfold docs.

    Solution
    » Add this to functions.php ofr your child theme:

    <script>
    (function($){
     $(document).ready(function(){
        $('#toggle-color-section').addClass('notseen');
        $('.avia-button-wrap.color-section-toggler a').click(function () {
         $('#toggle-color-section').toggleClass('notseen');
       
        });
      });
    })(jQuery);
    </script>

    Ad this to custom CSS:

    .notseen {
    	display: none;
    }

    Give the color section the ID: “#toggle-color-section”
    Give the button the class: “color-section-toggler”
    Gibe the button the link target: “javascript:void(0)” (so the page doesn’t reload)

    There was a code for changing button text as well out there on the forums, in case someone is interested.

    • This reply was modified 3 years, 9 months ago by mc_wa.
    #1284398

    Hi,

    Glad to know that it is working. And thank you for sharing the code.

    Best regards,
    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Color Section Toggle not working’ is closed to new replies.