I recently started developing a Cordova app and encountered an issue. Whenever I click on a specific div, its components are supposed to be displayed in a popup located at the center of the screen. This is the relevant code snippet:
var new_height = $('#' + id).height() + 20;
var new_width = $('#' + id).width() * 0.97;
$('#' + id + '_popup').width(new_width);
var move_up = $('#' + id + '_popup').height() / 2;
$('#' + id + '_popup').css({
"overflow-y": 'auto',
'transform': 'translateY(-' + $('#' + id + '_popup').height() / 2 + 'px)'
});
$('#' + id + '_popup').css("z-index", '3000');
However, I noticed that when I scroll down the page, the new div appears above the center position instead of staying centered. Can anyone suggest a solution for this issue?