-
Notifications
You must be signed in to change notification settings - Fork 840
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
Parallax jitter bad performance #45
Comments
I'm getting the same thing. I thought the "Bleed" just needed to be adjusted, but that didn't seem to work either. |
Using 50 pixel bleed seems to fix most of the bad performance, but aggressive scrolling still shows jitter. |
You can improve the smoothness slightly by applying the translation via an alteration to the transform3d's y value rather than the top: on the slider. I find this makes it quite smooth in Chrome. Safari will always stutter somewhat due to its lazy scroll reporting, particularly with foreground content in the parallax div it seems. |
I'm wary of relying too heavily on As @yuvadm noted, the I don't know currently of any way around this, but I would be open to suggestions. |
@mikegreiling I totally agree with your reasoning regarding transform3d, hence I offered it as a suggestion to users rather than a pull request. It can, however, be a useful technique subject to proper situational testing. This is particularly true in circumstances where all adjacent content is transparent and so the bleed option is not appropriate and also with "difficult" foreground content on occasions. The Safari problem is, as far as I can tell, pretty intractable and no amount of refactoring is going to help with the scroll reporting behavior, short of using scroll hijacking which comes with a whole new set of problems and limitations in the general use case. |
@atavernor can you post a patch that I can try out? |
@yuvadm We made wholesale changes to the plugin for our application but the translate part just needs applying to the render function as follow - I have commented out the original code and labelled the new code with ** at the start of the lines - obviously remove this. Apologies for the lack of a proper diff but I am on my iPad as I write this. I also doubt that the rounding of the pixel values has any effect but it was a case of try anything and it didn't show any adverse indications. render: function() {
** var transl = 'translate3d( 0px,' + Math.round(this.offsetTop) +'px, 0px)'; |
Hey guys, any updates on this since March? Also its most likely preferable to use the html method to invoke a parallax bg. In that case is there a way to apply the flicker fixes to all instances of parallax? I've implemented the code fix ^ to the library but the flickering is exactly the same. Also I cannot see a difference in the flickering. The bleed solution is acting really strange and interfering with surrounding divs. Any ideas? |
@BenRacicot If you are using bleed, the surrounding div's need to have a solid background color and you must ensure that the parallax image is behind them in z-index terms. I'm not sure what you mean by interfering but if you mean that the bleed is overlapping them then this will be the cause. The idea of the bleed area is just to hide the actual top and bottom edges of the parallax image where the redraw raster flicker is most noticeable. The translate above solution does not guarantee flicker free operation and it depends on your situation. We have found that some images cause flicker while some do not without any reasonable explanation. One thing for sure is that Safari consistently displays the worst flicker as I outlined above. |
Hi Guys, still doesn't resolved? still flickering on my end. |
I've fixed it with a bleed of 50. |
there has recently been merged a performance improvement, please check it out! |
Most basic usage of parallax.js is giving me weird behavior. I'm getting white background jitter above and below the parallax background when scrolling. Example: http://gfycat.com/ThoughtfulAcceptableCaribou
I'm using Firefox 36.0.1 on OS X, but this also reproduces on Safari + OS X and Firefox + Linux. Chrome seems to work fine everywhere.
The text was updated successfully, but these errors were encountered: