Comments (7)
Hi @Gillesvk
Can you show me an example on CodePen ?
from moveto.
Here is a link to a very simple example : codepen
As you will see, the top margin of the first section is ignored.
from moveto.
This is not a bug, it's a normal css behavior. The first section's margin is collapsing. You can check this link for more information.
from moveto.
Actually, it's not a margin collapsing issue because I apply only top margin on the child elements of the body, so there is no adjacent margin interference. In the codepen, I changed the background color of the body to pink and, as expected, the body contains the top margin of the first section.
Maybe, it's something to do with the choice between :
- window.scrollY,
- window.pageYOffset,
- document.body.scrollTop,
- document.documentElement.scrollTop
See this link
from moveto.
Check this codepen;
I added
display: flex;
flex-direction: column
to the body to prevent margin collapsing. As I said before, It seems like this is margin collapsing. Also you can see it clearly with inspect in the browser,
from moveto.
OK, thanks. Your plugin is awesome. So light.
from moveto.
You're welcome @Gillesvk , have a nice day 😉
from moveto.
Related Issues (18)
- Links don’t update URL with #hash HOT 5
- Some minifications suggestions HOT 1
- Multiple moveTo triggers doesn't work HOT 1
- Second click moves page on Top HOT 1
- Scroll inner div HOT 1
- Not Working in Firefox HOT 2
- Doesn't use proper browser History HOT 1
- Update polyfill document HOT 1
- Incorrectly looking target HOT 6
- Lazy loading images
- Offset for fixed header HOT 1
- doesnt work in flex div HOT 3
- Can this package support server side ?
- SyntaxError: Unexpected token: punc ()) - version 1.5.2 HOT 1
- demo中的easeFunctions下的easeInQuad有点问题~我不知道是不是我写的有错 HOT 1
- Problem with request animation frame loop HOT 1
- Focus remains on button HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moveto.