White Space above the image
See original GitHub issueI’ve read a few similar bugs that have been marked close, but no matter what I do, there’s always a gap above my image, likely from the math of the layout being off.
I’ve attempted to use $(window).trigger("resize").trigger("scroll");
and $(window).trigger('resize.px.parallax');
using on Load callbacks for the .parallax-slider
class and with other events to no success.
The gap corrects itself on page resize, but only then is it correct. Any ideas?
Issue Analytics
- State:
- Created 8 years ago
- Comments:26
Top Results From Across the Web
Remove white space below image [duplicate] - Stack Overflow
I've tried everything I can think of in Firebug with no luck. How can I remove this white space? Screenshot displaying white space...
Read more >How to Remove White Space Under an Image Using CSS
Answer: Use the CSS display property. If you try to put an image inside a <div> element that has borders, you will see...
Read more >White space above and below image - HTML-CSS
I am struggling to find a solution to making my background image and the transparent blue overlay to ... White space above and...
Read more >Adding Whitespace to an Image using Microsoft Paint
Adding Whitespace to an Image using Microsoft Paint. Open Microsoft Paint. Click View > Zoom > Zoom Out til you can see the...
Read more >blank space Meme Generator - Imgflip
Insanely fast, mobile-friendly meme generator. Make blank space memes or upload your own images to make custom memes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was having this issue as well.
In my case, I’m using bootstrap with parallax. Just like all of the above posters, I was running into the space issues after the user resizes the screen from 400px to 1200px or the other way around, which resulted in whitespace.
I believe (to my understanding), after resizing the window, parallax.js is calculating where everything is. Next bootstrap, rearranges everything which causes some whitespace.
My fix for this was: -after the user resizes, wait a tiny bit of time to let bootstrap rearrange everything and then run resize() with jQuery to have parallax recalculate everything.
Hopefully this helps
var timer;
$(window).bind('resize', function() {
clearTimeout(timer);
timer = setTimeout(function(){ $(window).resize(); }, 250);
});
EDIT: Sorry about the poor format. First time posting on this forum.
Also, thanks for making such a great plugin.
I actually found the source of my problem. I am also using a full width, responsive slider called LayerSlider, which is above my parallax sections. This slider area adjusts it’s height as it loads, which was causing that gap at the top of my parallax element. To fix this, I waited to call parallax() until LayerSlider loaded completely, using the
cbInit
callback in LayerSlider. Hope this helps someone!