开发者

Prevent firefox from resetting scroll position when overflow element changes

I am trying to implement a modal popup like the way facebook does it for previewing photos. From what I've inspected, the body becomes overflow:hidden and the modal box becomes overflow-y:scroll.

However, I have a bug in my website for firefox where when I change the overflow element from auto to hidden, it resets the scroll position of the page. This does not happen in Chrome开发者_C百科. Any workaround/fix for this? Thanks!

EDIT:

Thanks for your help. Please look at the jsfiddle http://jsfiddle.net/k3evQ/7/.

Greatly appreciate it!!!


Ended up scrapping the idea of changing the overflow to hidden. Thanks for all your help anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜