Comments (6)
Hi,
If you use some Pins functions, that will modify the global height of your document when you scroll, you will need to reclaculate the reall value of the scrollto.
For example:
A site contains 3 sections.
Your are on the top of the page (1rst section), and you want to click a link to scrollto the 3rd section.
Unfortunaly, you added a pin function to the second section.
So when you click the link, at this time, the scrolltop value of the 3rd section is simply $('#3rd_section').offset().top;
When the scrolling arrives on the 2cnd section, the pin function will apply, and the second section height will change. So the 3rd section top values will changes.
To fix it, you have to calculate the real top position of the 3rd section, which is:
Hope it helps.
Cheers
from superscrollorama.
could you show a demo please? I am a beginner in javascript
Thanks :)
from superscrollorama.
Of course.
Site is in developpement. Still some bugs.
http://www.thomaslartaud.com
Scroll down a bit, and try to click on 'portfolio'.
The processus section is a pinned one, but when you click on portfolio, the real value is calculated on mysc script, because i know that the processus section will be pinned during the scroll.
here is the code that might interest you:
$('#menu_portfolio').click(function(e){
e.preventDefault();
if(
TweenMax.to(
}else{
TweenMax.to(
}
});
I also added a test to know where i am on the page when i click the menu, because the value will be diffrent so.
Dont care about +410 and +10. This is the margin values of my div which are not included in the height() property.
You will also need to add +$(window).height() when you scroll from top, of course.
This code is actually not 100% working on my website, because i made a lot of changes in the processus section, but it show you how to think about it.
Cheers
from superscrollorama.
Hi i'm having the same kind of issue would this work if the pinned section is 100% height of the browser?
from superscrollorama.
Now you can use the method "setOffsetPosition".
from superscrollorama.
setOffsetPosition doesn't exist as far as I can tell.
I am also experiencing an issue when I use window.scrollTo(x,someY); because I am manually editing multiple backgrounds and spacer elements.
from superscrollorama.
Related Issues (20)
- Trouble with Mobile Superscrollerama HOT 2
- How to disable Superscrollorama in mobile devices? HOT 1
- Mac chrome lag HOT 2
- Make a tween.js version? HOT 1
- CSS problem HOT 4
- Scroll not working on PC mouse wheel HOT 1
- Superscrollorama and screen size/media queries HOT 1
- Superscrollorama autostart from top HOT 1
- Superscrollarama does not reverse start values HOT 4
- How do I scroll two time for pinned element before the window go to next pinned element HOT 1
- Adding delay to tween HOT 4
- Query: flashing mid animation HOT 1
- Skip pinned element HOT 4
- Is there a seek functionality ? HOT 1
- Uncaught TypeError: $.superscrollorama is not a function HOT 2
- Scrolling performance improvements via layerization HOT 4
- add package.json HOT 3
- Espaçamento no topo
- help scroll
- My SuperScroll Orama not working in firefox while working in chrome
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 superscrollorama.