Scrollstopping视差效果在Safari中不起作用 [英] Scrollstopping parallax effect not working in Safari

查看:93
本文介绍了Scrollstopping视差效果在Safari中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站有一个停止滚动的视差效果。我用来停止滚动的代码是:



My site has a stop-scrolling parallax effect. The code I use to stop the scrolling is:

if ( parseInt($("div#bg").css("top"), 10) <= -0 ) {
    $('#content').css('top', (-0) + 'px');
    $('#logo').css('margin-top', (-142) + 'px');
}





这在Chrome,Firefox和Opera中运行良好,但在Safari中则不然。在Safari中使用不同的代码吗?我知道Safari在滚动时有一个bug,但我找不到答案。是否有解决方法使其在Safari中也可以使用?或者某种我可以运行代码的编辑器?



This works fine in Chrome, Firefox and Opera but not so much in Safari. Is there a different code to use in Safari? I know Safari has a bug when it comes to scrolling, but I couldn't quite find an answer for it. Is there a workaround to make it also work in Safari? Or some kind of editor that I can run my code through?

推荐答案

div#bg)。css( top) , 10 )< = -0){
("div#bg").css("top"), 10) <= -0 ) {


' #content')。css(' top',( - 0)+ ' px');
('#content').css('top', (-0) + 'px');


' #logic')。css( ' margin-top',( - 142)+ ' PX');
}
('#logo').css('margin-top', (-142) + 'px'); }





这在Chrome,Firefox和Opera中运行良好,但在Safari中则不然。在Safari中使用不同的代码吗?我知道Safari在滚动时有一个bug,但我找不到答案。是否有解决方法使其在Safari中也可以使用?或者某种编辑器,我可以运行我的代码?



This works fine in Chrome, Firefox and Opera but not so much in Safari. Is there a different code to use in Safari? I know Safari has a bug when it comes to scrolling, but I couldn't quite find an answer for it. Is there a workaround to make it also work in Safari? Or some kind of editor that I can run my code through?


这篇关于Scrollstopping视差效果在Safari中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆