-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decreasing slide padding makes scrolling not work #34
Comments
Hi Nokenwari, This is a little tricky to explain - but here goes. The padding has been added to the slides as the waypoint script is configured to trigger the navigation .active class when the slide hits the top of the viewport. Also the animation of the slides has been configured to move the slide to the very top of the viewport. The problem being is that the header is 90px tall. You can configure waypoint to trigger the navigation change at whatever distance you like from the top of the viewport. In my case i needed my header to be 130px tall. And i didn't want any padding on my slides, as i needed the content to be at the edge. This is what i did.. Edit script.js: After the code block:$(window).stellar();
Add this function slide.waypoint(function() { THEN ADD AN OFFSET DISTANCE TO THE JQUERY ANIMATION ALREADY IN THE SCRIPT function goToByScroll(dataslide) { Hope that helps... I haven't fully tested this yet, but it appears to work. |
Great. Thanks. The offset was exactly what I was looking for. I wonder if a future mod could get the CSS padding value via jQuery to make adaptation only require changes to the CSS, eg. var slidepad = $('.slide[data-slide="' + dataslide + '"]').css('padding-top'); Then offset by the slidepad amount. |
Hi Nokenwari, I have adjusted the script to fetch the .menu height dynamically. See my post here for details: |
Thanks for your help. |
Hi, I was wondering if you could give me some advice. I am new to this but find your design great. I have removed padding from the grid which is fine. But after my fullsrceen videos there is a bottom line of padding which I need to remove. I have played around with the css and can't figure it out. When I remove content:"" from the grid style it works but breaks everything else. (.clearfix:after{clear:both; content:'';) I would really love if someone can help me with this, I have been at it for quite a while and my head feels like it may explode. Thanks |
Hi.
I've tried to reduce the amount of padding at the top and bottom of the .slide class (to 80px) but find that the navigation links then scroll a bit too far, resulting in the slide title scrolling off the top of the page, especially on a small screen.
I can't see in the JS where this might be caused.
Any suggestions?
The text was updated successfully, but these errors were encountered: