Lucas Lopes Steinert
Lucas Lopes Steinert

Reputation: 21

why does this on scroll code work in the Browser and not on Mobile?

I have the following code snippet:

<script language="javascript">
var readAll = false;
$("#termo").on("scroll", function() {

    if (readAll) return;

    readAll = this.scrollHeight - this.scrollTop === this.clientHeight;

    if (readAll) {
        document.getElementById("aceitetermo").disabled = false;
    }
});

This code works perfectly on the computer in both browser and mobile mode, enabling the button at the end of the scroll. However when I test on the phone by Chrome it does not run. In Mozilla it works normally.

Does anyone have any idea what it could be?

Upvotes: 2

Views: 59

Answers (0)

Related Questions