digitalcraftsman / hugo-agency-theme

Port of Startbootstrap's Agency theme to Hugo
http://themes.gohugo.io/theme/agency/
Apache License 2.0
160 stars 137 forks source link

Prevent body from scrolling to top when modal is opened. #86

Closed onedrawingperday closed 7 years ago

onedrawingperday commented 7 years ago

@digitalcraftsman In the online demo of the theme (https://themes.gohugo.io/theme/agency/) the body element does not scroll at all when the portfolio modal is opened.

But when running the example site locally (without any modifications) I have run into the following:

When the modal is opened the body scrolls to the top as the modal-open class is being added to it and then when the modal is closed the body scrolls down again roughly (but not exactly) to the point where it was when the modal was first opened.

It's a bit of a distracting animation and I would like to get rid of it. Any pointers?

onedrawingperday commented 7 years ago

Never mind. I found a way to do what I need.