Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrolling in Modal makes background scroll on Safari

I need to have some help with an annoying thing. I have an modal popup which has vertical scrollsbar inside. When scrolling inside the modal sometimes the background scrolls instead. I have tried to add

body{
position:relative;
overflow: hidden;
}

which works fine on most of the browsers, but Safari for my iPhone still scrolls!

Please help me find how to solve this!

Regards Kristian

like image 386
Krillehbg Avatar asked Nov 13 '22 07:11

Krillehbg


1 Answers

$('body').css('overflow','hidden');
$('body').css('position','fixed');

Did it for me.

like image 61
ELEx Avatar answered Nov 15 '22 06:11

ELEx