Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1061311

    Hello,
    So I have setup a color section that is toggled by a button in the color section above it. So when you click the button it opens the color section below. The problem I’m having is I can’t get the color section below to scroll into view. Here is the code I’m using in the functions.php

    jQuery(document).ready(function( $ ) {
    $(“.togglebutton”).click(function(){
    if ($(‘#multicurrencymore’).css(‘display’) == ‘none’)
    {
    $(“#multicurrencymore”).css(“display”,”block”);
    }
    else
    {
    $(“#multicurrencymore”).css(“display”,”none”);
    }
    document.getElementById(‘diecimetri’).scrollIntoView(true);
    });
    });

    #1061363

    Got it
    jQuery(window).load(function(){

    // Button onClick event

    jQuery(“.toggle-button a”).on(“click”, function(e) {

    // Add your button events here

    console.log(” toggle section”);

    jQuery(“#ourfounders”).toggleClass(“show”);

    if(jQuery(“#ourfounders”).hasClass(“show”)){
    jQuery(“html, body”).animate({ scrollTop: jQuery(“#ourfounders”).offset().top }, 500);
    }

    e.preventDefault();

    });

    });

    #1061940

    Hi,

    Great, glad you found a solution and thanks for sharing. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.