I'm working on a site using scrollr.js and I get a problem with height issues as elements comes in. As a reference, I'm using the scripts found on this template.
In the first screenshot, I get a large gap between my elements that fade in from both sides and the element below. However, in the second screenshot, you can see that everything is fixed when I refresh the page.
Screenshot 1
Screen shot 2
This is a recurring problem in Firefox (Mac/PC), Safari, Chrome (Mac/PC), and IE (10 and lower, untested on IE11, but having doubts the problem remains). All browsers are up to date (except IE).
Files
For reference (and testing) purposes, I did try linking directly to the files used by the template mentioned above. This scripts have not been changed in my local files.
<script src="http://themify.me/demo/themes/parallax/wp-content/themes/parallax/js/skrollr.js?ver=3.6.1"></script>
<script type='text/javascript' src='http://themify.me/demo/themes/parallax/wp-content/themes/parallax/js/themify.script.js?ver=3.6.1'></script>
<script>skrollr.init({mobileCheck: function(){return false;}});</script>
Attempts
- Loading the init on
window.load
and ondocument.ready
-> No change - Refreshing the page via jQuery, meta refresh and refreshing only the div -> No change
- Tried using the
src
directly from the template on Themify -> No change - Calling any other script after this has been processed -> No change
- Resizing the window -> corrects the issue, but asking people to resize the window doesn't make any sense
- {forceHeight: false} option
What I've noticed
I've realized that on a page where I have more elements using this effect, the gap seems to get smaller. This is somewhat annoying since this would mean the script itself works, but needs more height on my page.
My div code :
<article style="left: 0px; top: 0px; opacity: 1;"
data-bottom-top="left[sqrt]: -400px;top[sqrt]:200px;opacity: 0;"
data-center-top="left[sqrt]:0px;top[sqrt]:0px;opacity:1;"
class="highlight type-highlight post col2-2 skrollable skrollable-after">
<figure class="post-image">
<img src="imges/picture1.jpg" />
</figure>
</article>
<article style="right: 0px; top: 0px; opacity: 1;"
data-bottom-top="right[sqrt]:-200px;top[sqrt]:200px;opacity:0;"
data-center-top="right[sqrt]:0px;top[sqrt]:0px;opacity: 1;"
class="highlight type-highlight post col2-2 skrollable skrollable-after">
<div class="post-content">
<h2>Heading</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ullamcorper justo at sollicitudin posuere. Nulla elementum, turpis vel posuere egestas, nisi diam malesuada arcu, eu pulvinar nunc mi vitae odio. Aliquam semper eros nec quam tempor, vitae ultrices turpis posuere. Aliquam mi massa, imperdiet at diam nec, volutpat vulputate dolor. Curabitur condimentum dolor tortor, at laoreet risus condimentum a. Mauris lobortis ut magna nec egestas. Etiam at accumsan est. Donec gravida scelerisque lorem sit amet vestibulum.
</p>
</div>
</article>
And, from testing, smaller pages don't allow for top[sqrt]:200px;
; this value must be smaller (in some cases, 0, making the effect only left/right as opposed to coming in on an angle as well, which was what originally caught my attention).