controlling bootstrap modal position


#1

I have tried to read up about this and have tried endless solutions without success. I want to display a modal without the background scrolling to the top. Almost everyone suggests some variant of overfow control but it simply doesnt work. Can anyone suggest how I might achive this please? In desperation I feel I may have to do some smart stuff with viewport/page position and foce the .modal-open styles on body? Again any help would be really appreciated, thx Paul


#2

I haven’t worked with Bootstrap for a while though I’m fairly sure I can steer you in the right direction. The background, the page you are on now with a modal overlay, is scrolling to the top position on open. The reason behind Bootstrap doing this is to help deal with background scroll and the probability that the modal could also create it’s own scrollbar (auto). Double scrollbars are ugly! :grin: What you would more likely want to do is get into the jQuery or JavaScript that is controlling this behaviour to see what it’s doing. If it’s toggling a class to change the css attribute then you could get to that class and edit it to your liking. You would more than likely want to apply overflow-y: hidden;