question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

White Space above the image

See original GitHub issue

I’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.

screen shot 2016-03-01 at 1 40 22 pm

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:closed
  • Created 8 years ago
  • Comments:26

github_iconTop GitHub Comments

4reactions
PerryM123commented, May 12, 2016

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.

2reactions
GaryReckardcommented, Apr 28, 2016

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found