I'm using Javascript (no jQuery) and I have a sub-menu element that pops up which at times goes beyond the bottom of the viewer, so I used scrollIntoView to have the sub-menu instantly move to be have all the line items fully within the viewport (i.e bottom of sub-menu aligns with bottom of viewport.
document.getElementById('sub1').scrollIntoView(false);
However, I then added a 2px border to that sub-menu element, and although the line items of the sub-menu appear fully within the viewer, the border does not; it remains off the bottom of the viewport. Is there a way to include the border in the scrollIntoView without adding another element to the page?
Thanks in advance.