0

I have a funnel in clickfunnels that in the footer section i added a script for making a toggle hide/show a specific section that is basically invisible and show up only with the image-button.

My problem is that i can't figure out how to jump on the section when it shows up(Smoothly)

This is the piece of code that does the toggle:

    var toggle;
    function docReady(fn) {
         if (document.readyState === "complete" || document.readyState === "interactive") {
             setTimeout(fn, 1);
         } else {
             document.addEventListener("DOMContentLoaded", fn);
         }
    }

    docReady(function() { 
        toggle = true;
    });

    $("#tmp_image-67696").click(function(e) {
        e.stopPropagation();
        if(toggle) {
            $("#row--91312").css("display","block");
            toggle = !toggle;
        } else {
            $("#row--91312").css("display","none");
            toggle = !toggle;
        }
    });

Basically I want the same image-button that toggles and show the section, to jump the view onto the same section, not just shows it like dropdown.

Thanks in advance!

Diamoc
  • 1
  • Try [this](https://stackoverflow.com/a/7717572/8839059). It is using scrollIntoView. Maybe you'll also need to set `scroll-behavior: smooth` on your `html` tag (css) – Rafael Tavares Feb 12 '20 at 13:35
  • Does this answer your question? [Smooth scroll to div id jQuery](https://stackoverflow.com/questions/19012495/smooth-scroll-to-div-id-jquery) – Mihai T Feb 12 '20 at 13:37
  • Welcome to SO! a shortest way is use `html { scroll-behavior: smooth; }` – Awais Feb 12 '20 at 13:53

0 Answers0