Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
264 views
in Technique[技术] by (71.8m points)

javascript - 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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...