当浏览器缩小时 jQuery 函数停止
我正在使用 SmoothDivScroll 1.1,一切工作正常,直到我在浏览器中缩小(firefox、chrome 和 safari 在 Windows 7 上测试)(放大时滚动条不会停止)。 SmoothDivScroll 的加载方式是:
$(window).load(function() {
$("div#projectenRijEen").smoothDivScroll({});
$("div#projectenRijTwee").smoothDivScroll({});
$("div#projectenRijDrie").smoothDivScroll({});
$("div#projectenRijEen").bind("mouseover",function(){$(this).smoothDivScroll("stopAutoScroll")}).bind("mouseout",function(){$(this).smoothDivScroll("startAutoScroll")});
$("div#projectenRijTwee").bind("mouseover",function(){$(this).smoothDivScroll("stopAutoScroll")}).bind("mouseout",function(){$(this).smoothDivScroll("startAutoScroll")});
$("div#projectenRijDrie").bind("mouseover",function(){$(this).smoothDivScroll("stopAutoScroll")}).bind("mouseout",function(){$(this).smoothDivScroll("startAutoScroll")})
});
我尝试了以下方法:
$(window).load(function() {
var $scrollElement = $("div#projectenRijEen");
$scrollElement.smoothDivScroll({});
$(window).resize(function () {
$scrollElement.data({
motherElementOffset: $scrollElement.offset().left
});
});
});
在 http://www.codingforums 上找到.com/showthread.php?t=241455,但我无法让它工作
有人可以帮助我如何在缩小时保持滚动条滚动吗?
I'm using SmoothDivScroll 1.1 and everything is working fine till I zoom out in a browser (firefox, chrome and safari tested on windows 7) (when zoomed in the scroller doesn't stop). The way SmoothDivScroll is loaded is:
$(window).load(function() {
$("div#projectenRijEen").smoothDivScroll({});
$("div#projectenRijTwee").smoothDivScroll({});
$("div#projectenRijDrie").smoothDivScroll({});
$("div#projectenRijEen").bind("mouseover",function(){$(this).smoothDivScroll("stopAutoScroll")}).bind("mouseout",function(){$(this).smoothDivScroll("startAutoScroll")});
$("div#projectenRijTwee").bind("mouseover",function(){$(this).smoothDivScroll("stopAutoScroll")}).bind("mouseout",function(){$(this).smoothDivScroll("startAutoScroll")});
$("div#projectenRijDrie").bind("mouseover",function(){$(this).smoothDivScroll("stopAutoScroll")}).bind("mouseout",function(){$(this).smoothDivScroll("startAutoScroll")})
});
I tried te following:
$(window).load(function() {
var $scrollElement = $("div#projectenRijEen");
$scrollElement.smoothDivScroll({});
$(window).resize(function () {
$scrollElement.data({
motherElementOffset: $scrollElement.offset().left
});
});
});
found on http://www.codingforums.com/showthread.php?t=241455, but I couldn't get it working
Can somebody please help me how to keep te scroller scrolling when zooming out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我意识到这个问题并做了一些测试并尝试了一些技巧来解决它。到目前为止我已经取得了一些进展,但这是一个棘手的问题,我还没有解决问题。 GitHub 上报告了此问题 (https://github.com/tkahn/Smooth- Div-Scroll/issues/2)。您可以关注那里的讨论。
I'm aware of this problem and have done some tests and tried some tricks to solve it. So far I have made some progress, but it's a tricky problem and I haven't solved the problem yet. This issue is reported on GitHub (https://github.com/tkahn/Smooth-Div-Scroll/issues/2). You can follow the discussion there.