Plugin

Developer
Supported

AJAX Babble

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Laisvunas

     

You must be logged in to post.

scrollIntoView() offset for Sticky Header

Support Request

exida2014
exida2014

Hello,

The site I’m developing has a sticky header.  When you submit the comment, it appears out of view.  How can I offset the scroll to view.

scrollCommentIntoView: function() {
    
var comment_to_scroll;
    
    if (
ajaxBabbleEntry<?$entry_id ?>.css_id_to_scroll{
      comment_to_scroll 
document.getElementById(ajaxBabbleEntry<?$entry_id ?>.css_id_to_scroll);
      if (
comment_to_scroll{
        comment_to_scroll
.scrollIntoView();
        
//alert('commment scrolledinto view!');
        //comment_to_scroll.style.border = 'solid 1px red';
      
}
    }
  }
Laisvunas
# 1
Developer
Laisvunas

Hi,

If you need not scrolling into view functionality, just don’t use “css_id_to_scroll” parameter.