Hello! There is a page at the top where the iframe into which the advertiser loads the banner with the advertisement. At the bottom of the page is the div id = "video" in which the video in the iframe. How to make the user page scroll down to the video by clicking on this banner at the top? I tried:

$(function() { var scrollToAnchor = function() { var elem = $("#tabs_video"); $('html, body').animate({ scrollTop: elem.offset().top }, 1000 ); }; // bind to click event $(".js-scroll").click(function( event ) { event.preventDefault(); scrollToAnchor(); }); 

});

    1 answer 1

    try this

     $(".js-scroll").click(function( event ) { event.preventDefault(); $('html, body').animate({ scrollTop: $("#tabs_video").position().top }, 1000 ); });