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);
});
});
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();
});
});