当我尝试在移动设备上滚动网站时,我的网站出现问题,有时它会锁定,甚至当您在设备网站上滑动手指时也无法正常移动。在桌面滚动工作正常。我试图找到解决方案,但无法弄清楚出了什么问题。
您可以在此处使用 375 像素分辨率或移动设备上的开发人员工具对其进行测试
Bootstrap 4 模板: NOW UI Kit by Creative Tim
我认为问题出在 cookie 脚本上,但是当我通过在 HTML 中注释来禁用它时,问题并没有解决。我试图评论我的 JS 文件的一部分,但仍然无法正常工作。
有我的 JS 脚本:
var selectedClass = "";
$(".filter").click(function () {
selectedClass = $(this).attr("data-rel");
$("#gallery").fadeTo(100, 0.1);
$("#gallery div").not("." + selectedClass).fadeOut().removeClass('animation');
setTimeout(function () {
$("." + selectedClass).fadeIn().addClass('animation');
$("#gallery").fadeTo(300, 1);
}, 300);
});
$( "#scrollDown" ).click(function() {
$( "html, body" ).animate({
scrollTop: 600
}, 600, function() {
// Animation complete.
});
});
//Gallery Animations
baguetteBox.run('.grid-gallery', { animation: 'slideIn' });
//Anchor Function
function scrollToAnchor(aid){
let aTag = $("a[name='"+ aid +"']");
$('html,body').animate({scrollTop: aTag.offset().top}, 900);
}
//Menu Anchors Animations
$("#lexuslink").click(function() {
scrollToAnchor('lexus');
});
$("#fiatlink").click(function() {
scrollToAnchor('fiat');
});
$("#merclink").click(function() {
scrollToAnchor('merc');
});
$("#homelink").click(function(){
$('html, body').animate({scrollTop: 0}, 900)
});
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
});
}
});
});
沧海一幻觉
阿波罗的战车
随时随地看视频慕课网APP
相关分类