I'm trying to build a popup window like the one here.
In this case, when I click the CUSTOMISE button, a window appears below the button. If the element is not entirely visible on the screen, the page scroll down or up until it is completely visible.
I was able to achieve half the result:
$('body').on('click',"#"+ID,function () {
        var $this = $(this);
        $('#attr-div-'+baseId).css({
            top: $this.position().top+55,
        }).show();
    });
How can I scroll the page until the element is entirely visible? Thanks!
 
    