Skip to content

Commit 604a166

Browse files
authored
Update README.md
1 parent c31c3df commit 604a166

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ So now you have a `<div>` which you can scroll with *momentum* and all, but **th
2020

2121
The problem with this is that you can't center UI elements on the screen like modals, or use `position:fixed;`for say a top menu bar. Remember that the `<iframe>` itself never scrolls, you are scrolling the container. This means a fixed element will remained fixed inside the `<iframe>` but not the container which is what you are scrolling.
2222

23-
You may think that you should be able to solve this using Javascript but you can't. Again, you can't know the position of the scroll since the `<iframe>` never scrolls and you have no way of positioning your UI elements depending on the scroll position. So you effectively have no way of knowing where the center or top positions are.
23+
You may think that you should be able to solve this using Javascript but you can't. Again, you can't know the position of the scroll since the `<iframe>` never scrolls and you have no way of positioning your UI elements depending on the scroll position. So you effectively have no way of knowing where the center or top positions are (relatively speaking).
2424

2525
###Solution
2626
After messing with this for a few hours the solution for my case was to to wrap all the content of the `<iframe>` and use this CSS on the wrapper:

0 commit comments

Comments
 (0)