Scroll position based on the previous window

zineberrada
Tera Contributor

Hello All.

 

In my service portal I have a burger menu wich contains a button  that opens a modal window. but It opens based on the scroll position of the previous window, meaning it either opens at the bottom of the page if the scroll bar is positioned at the bottom or in the center if it's positioned in the center so I have to scroll to the top each time I open the modal window. Any ideas on how to force modal windows to open automatically scrolled to the top?

 

I have tried this solution :

 i have already and id = popUp in my HTML CODE, but this didnt work.

 

var conteneur = $("#popUp");
$scope.btnModifier = function() {
$(".fullscreen-container-debrief").fadeTo(200, 1);
// Check if  container exist
if (conteneur.length) {
// scroll top
$("html, body").animate({
scrollTop: conteneur.offset().top
}, 200);

 

Any advice please ?

Much thanks,

Zineb

0 REPLIES 0