jquery-match-height icon indicating copy to clipboard operation
jquery-match-height copied to clipboard

Maintain Scroll Position (Fails on Mobile)

Open zgjonbalaj opened this issue 9 years ago • 5 comments

I am having an issue with the maintain height on mobile phone, the page will jump to the top when you scroll all the way down. The flag is there but it doesnt seem to do any good, ive tried a few different things including a timeout, data-mh attributes.

This is my markup

`

        <div class="col-xs-12 col-md-5 col-lg-5">
            <div class="left-footer-col eh clearfix">
                <address>
                    Address Here
                </address>

                <div class="copyright">
                    Copyright Here
                </div>
            </div>
        </div>

        <div class="col-xs-12 col-md-7 col-lg-7">
            <div class="right-footer-col eh clearfix">
                <? require("_includes/nav/footer.inc") ?>
            </div>
        </div>
    </div>
</div>
`

This is my JS

`$(document).ready(function() { $.fn.matchHeight._maintainScroll = true; });

$(window).load(function() { setTimeout(function() { $(".eh").matchHeight(); }, 1); });

$(window).resize(function() { $.fn.matchHeight._update() });`

zgjonbalaj avatar Jul 06 '16 15:07 zgjonbalaj

Can you tell me the model of the phone and the browser version?

liabru avatar Jul 06 '16 16:07 liabru

It seems to be on all phones we've tested including

  1. Android Nexus 6 - Running Android 6.0.1
  2. iPhone 5 & 6

On Wed, Jul 6, 2016 at 12:21 PM, Liam [email protected] wrote:

Can you tell me the model of the phone and the browser version?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/liabru/jquery-match-height/issues/121#issuecomment-230825372, or mute the thread https://github.com/notifications/unsubscribe/AF4vuhxiaC-mN9rPWJIDTHy5Mdf-ijm6ks5qS9YLgaJpZM4JGMqy .

zgjonbalaj avatar Jul 06 '16 17:07 zgjonbalaj

Did this ever get resolved? I'm noticing this on ios, page jumps caused by the _update method, _maintainScroll is set to true

danjaywing avatar Oct 16 '17 09:10 danjaywing

Nope, still experience this quite often my only fix is to add a set time out delay to the function. Moving it around to page load instead of document ready also seems to help.

On Oct 16, 2017 5:36 AM, "danjaywing" [email protected] wrote:

Did this ever get resolved? I'm noticing this on ios, page jumps caused by the _update method, _maintainScroll is set to true

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/liabru/jquery-match-height/issues/121#issuecomment-336833637, or mute the thread https://github.com/notifications/unsubscribe-auth/AF4vupPGBgjznN554j1-SZwvqXhYMNLqks5ssyOUgaJpZM4JGMqy .

zgjonbalaj avatar Oct 17 '17 05:10 zgjonbalaj

Unfortunately _maintainScroll is only approximate, certain content changes will throw the estimation off more than others.

If it helps anyone, the exact implementation is just this line.

Maybe there's a bug with newer mobile browsers, does anybody have a good example link showing it?

liabru avatar Oct 17 '17 09:10 liabru