- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello,
How to reduce the site when scrolling?
Example: http://doze.studio/
If you scroll down the site, then the border around the edges will increase. How can I do this?
Please, help
If you inspect the page with the developer console (F12) it shows that they’re using 4 separate elements – one for each border;
They’re initially hidden off-screen with transform: translate3d()
These styles are inline in the elements themselves, so most likely, they’re using JavaScript to watch page scroll position, and also (re)calculate each (new) translated position and write it inline, on the fly. This is what makes the border bars move in and out as the user scrolls.
I wrote a “Add Class to Target-Element when Trigger-Element is Scrolled into View” script which can be used to achieve something similar, although it doesn’t incrementally alter the border movement at each tiny scroll change. It either moves it in, or moves it out when triggered (no middle ground).
Here’s the blog and script demos http://blog.fofwebdesign.co.uk/41-add-classes-to-an-element-when-scrolled-into-viewport
And here’s a makeshift moving border demo using a simplified version of the script https://codepen.io/anon/pen/vaXqbX
The CodePen demo doesn’t seem to work on mobile, but it does when transferred to a standalone page http://fofwebdesign.co.uk/template/_testing/scroll-in-view/borders-on-scroll.htm
I can not do it :c
I’m dumb to do this :c
Great post!
It is too hard to understand the codepan demo. Can anyone help me to find Online website or tools to converter for PNG files into BMP?