<script>
var stickyEl = document.querySelector(".pannle-label");
function fixed() {
var u = navigator.userAgent;
var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1;
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
//
if(isAndroid) {
console.log("isAndroid")
window.onscroll = function() {
console.log(2222);
var scrollT = document.documentElement.scrollTop||document.body.scrollTop;
if (scrollT > 160) {
$(stickyEl).addClass("fixed-top");
}else {
$(stickyEl).removeClass("fixed-top");
}
};
}else if(isiOS) {
console.log("isiOS");
$(stickyEl).addClass("sticky");
}
}
fixed();
</script>
as shown in the code above, there are effects on ios, but if there are problems on Android, let me make a list of questions and take a look at
- the console didn"t output 2222 when I was scrolling
- I also see that there seems to be a problem with overflow with css, but I don"t know exactly
- css is it possible that the display:none; of the scroll bar is this problem
solve!