Mac OS X Lion、滚动条和网站可用性

发布于 2024-11-25 19:58:42 字数 429 浏览 2 评论 0原文

我有许多溢出的 div,用于在小空间中显示大量内容(如长列表等)。为 div 指定 overflow: auto; 的 CSS 规则总是像魅力一样发挥作用,为用户提供滚动条以指示有更多内容可用。

这在 Mac OS X Lion 中有点被抛弃了,它(默认情况下)会隐藏滚动条,除非您主动滚动。我喜欢在计算机上处​​理应用程序,因为我认为有非常强烈的视觉线索,您可以滚动查看更多内容。在网页元素上,它不太清晰,我担心我的用户不知道有更多可用的内容(恰当的例子:输入新问题时 StackOverflow 的“具有相似标题的问题”就是一个很好的例子)。

这是一个合理的担忧,还是 Lion 用户知道如果某些内容似乎被切断,则表明滚动可能可用?是否有任何解决方法,例如,如果滚动条是页面上的元素(而不是页面本身),则强制在 Lion 上运行的浏览器渲染滚动条?

I have a number of overflowed divs that I use to display a lot of content in small space (like long lists, etc). Giving the divs the CSS rule of overflow: auto; always worked like a charm, giving the user scroll bars to indicate more content was available.

This is kinda thrown out the window with Mac OS X Lion, which (as a default) hides the scroll bars unless you're actively scrolling. I like it when dealing with an application on my computer, because I think there are very strong visual clues that you can scroll to see more content. On webpage elements, it's a lot less clear, and I'm worried that my users won't know there's more content available (case in point: StackOverflow's "Questions with similar titles" when entering in a new question is a good example of this).

Is this a legitimate concern, or will Lion users know that if something appears to be cut off, it indicates that scrolling might be available? Are there any workarounds to, say, force browsers running on Lion to render scroll bars if it's an element on the page (and not the page itself)??

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

老街孤人 2024-12-02 19:58:42

我不同意这一点。是的,我理解 UI/UX 的争论。然而,某些网站,尤其是水平导航方法需要这样做,因为用户可能不知道导航是水平进行的。然而,已经提到了强制它的修复。我发现这工作正常:

在 Mac Safari Chrome 等中打开我的代码(JS FIDDLE PREVIEW)

<style type="text/css">
#horiz_scroll::-webkit-scrollbar {
-webkit-appearance:none !important;
width:11px !important
}
#horiz_scroll::-webkit-scrollbar {
border-radius:8px !important;
border:2px solid white !important;
background-color:#ccc !important
}
#horiz_scroll::-webkit-scrollbar-thumb {
border-radius:8px !important;
border:2px solid white !important;
background-color:rgba(0,0,0,.5) !important
}
/*
// If you want it on hover //
#horiz_scroll::-webkit-scrollbar:active,
#horiz_scroll::-webkit-scrollbar:hover, 
#horiz_scroll::-webkit-scrollbar:focus{border-radius:8px !important;border:2px solid white !important;background-color:#ccc !important}
*/
</style>

<div id="horiz_scroll" style="width:943px;height:480px;overflow:auto"> 
  <!-- Just fit content inside this that scrolls horizontally. Example -->
  <table id="Table_01" height="350" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td>
        <div style="background:#eee;width:9000px;min-height:400px">hello</div>
      </td>
    </tr>        
  </table>
</div>

I disagree with this. Yes, I understand the UI/UX argument. However some sites, especially the Horizontal approach for navigation would need this as users may not know navigation goes horizontally. A fix to force it however has been mentioned. I have found this works fine:

Open my code in Mac Safari Chrome etc (JS FIDDLE PREVIEW)

<style type="text/css">
#horiz_scroll::-webkit-scrollbar {
-webkit-appearance:none !important;
width:11px !important
}
#horiz_scroll::-webkit-scrollbar {
border-radius:8px !important;
border:2px solid white !important;
background-color:#ccc !important
}
#horiz_scroll::-webkit-scrollbar-thumb {
border-radius:8px !important;
border:2px solid white !important;
background-color:rgba(0,0,0,.5) !important
}
/*
// If you want it on hover //
#horiz_scroll::-webkit-scrollbar:active,
#horiz_scroll::-webkit-scrollbar:hover, 
#horiz_scroll::-webkit-scrollbar:focus{border-radius:8px !important;border:2px solid white !important;background-color:#ccc !important}
*/
</style>

<div id="horiz_scroll" style="width:943px;height:480px;overflow:auto"> 
  <!-- Just fit content inside this that scrolls horizontally. Example -->
  <table id="Table_01" height="350" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td>
        <div style="background:#eee;width:9000px;min-height:400px">hello</div>
      </td>
    </tr>        
  </table>
</div>
九歌凝 2024-12-02 19:58:42

是否有任何解决方法,例如,强制在 Lion 上运行的浏览器渲染滚动条(如果它是页面上的元素)

这是一种攻击。让系统来处理它。如果用户使用Lion,那是因为他们喜欢这个。如果他们使用它并且不喜欢新的滚动条,他们只会在系统偏好设置中更改它。

Are there any workarounds to, say, force browsers running on Lion to render scroll bars if it's an element on the page

This is an attack. Let the system take care of it. If the user uses Lion, that's because they like this. And if they use it and don't like the new scroll bars, they will just change that in System Preferences.

朮生 2024-12-02 19:58:42

Lion 确实通过在任何可滚动元素进入视图时瞬间闪烁滚动条来解决此问题,从而向用户提供初步提示,表明还有更多内容可以滚动。当然,用户可能注意到也可能没有注意到这一点。如果用户习惯了 Lion 的做事方式,您的网站将不会是唯一发生这种情况的地方,并且用户可能知道如何处理它。如果您的盒子在没有滚动条的情况下“不可滚动”,您可能需要提供更强烈的指示,表明它们是可滚动的,例如,通过在盒子周围有一个清晰的边框,并在里面包含一些截止内容。无论狮子如何,这可能都是您想做的事情。

如果您可以改进 UI 以使可滚动性更加明显,请采用任何一种方法。否则,如果您的内容以暗示还有更多内容的方式呈现,那么如果用户应该习惯它,我就不会担心系统上缺少滚动条。

您可能需要访问 https://ux.stackexchange.com/ 获取一些真正的专家意见。

Lion does take care of this itself by flashing the scrollbars on any scrollable element for an instant when it comes into view, giving the user an initial hint that there's more to scroll to. Of course, the user may or may not notice this. If the user is used to the Lion way of doing things, your website won't be the only place this happens and the user probably knows how to deal with it. If your boxen look "unscrollable" without scrollbars, you might want to give a stronger indication that they are scrollable, e.g. by having a clear border around the box with some cut-off content inside. This may be something you will want to do regardless of Lion.

If you can improve your UI to make scrollability more obvious, do it either way. Otherwise, if your content is presented in a way that suggests there's more, I wouldn't worry about missing scrollbars on a system were the user should be used to it.

You may want to take this to https://ux.stackexchange.com/ for some real expert opinions.

亚希 2024-12-02 19:58:42

OS X Lion 实际上只是在强制解决这个问题。移动浏览器(iOS 和 Andriod)的用户多年来一直对此抱怨不休……溢出技巧通常不起作用;您需要更加仔细地考虑页面设计或超越标准浏览器行为并添加对触摸和滚动的 javascript 支持(例如 jqTouch)。

不幸的是,Lion 的滚动条行为不仅仅影响网站。例如,它使我与具有大显示设置的计算机的 vnc 会话非常烦人(必须调整 vnc 窗口大小才能说服 Lion 显示滚动条)。

双重不幸的是,解决方案是转到“首选项>常规>显示滚动条:”并设置为“始终”。这有点抵消了苹果可能一直试图与 Lion 建立的任何前进动力。但能够真正使用该死的东西是一张通用王牌。

OS X Lion is really just forcing the issue. Users of mobile browsers (both iOS and Andriod) have been bitching about this for ages ... the overflow trick does not work in general; you need to think harder about page design or look beyond standard browser behaviour and add javascript support for touch and scrolling (e.g. jqTouch).

Unfortunately, Lion's scrollbar behaviour doesn't just affect web sites. For example, it makes my vnc sessions to machines with large display settings pretty annoying (have to resize the vnc window to convince Lion to show me a scrollbar).

Doubly unfortunately, the solution is to go to "Preferences > General > Show scrollbars:" and set to "always". Kind of undoes any forward momentum that Apple may have been trying to build with Lion. But being able to actually use the damn thing is a general purpose trump card..

咿呀咿呀哟 2024-12-02 19:58:42

我正在处理同样的问题。这是我找到的修复方法。它使得滚动条始终出现在我测试的 Mac Air 和 iPad 上的 Safari 中。当然,这只是在有更多内容可看的情况下。当所有内容都显示时就不会了。

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}
::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0,0,0,.5);
    -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}

I was JUST dealing with this same issue. Here is the fix I found. It makes the scroll bar always appear with Safari on the Mac Air and iPad I tested with. Of course, this is only when there is more content to be seen. Not when all the content is shown.

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}
::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0,0,0,.5);
    -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}
暗喜 2024-12-02 19:58:42

作为一名 Mac 用户,我不会参与有关 Lion 是否应该隐藏滚动条的哲学讨论。

至于强制滚动条出现在网页元素中,只需设置 CSS 的 overflow:scroll 即可。这会将垂直和水平滚动条设置为始终显示,并且当它们没有任何可滚动内容时非常明显。

如果您只希望它垂直或水平滚动,而不显示其他维度的滚动条,则可以分别使用 overflow-y:scrolloverflow-x:scroll ,而不是溢出:滚动。这适用于所有现代浏览器,但不适用于 IE8 及更低版本。

Not being a mac user, I shall stay out of the philosophical discussion as to whether or not Lion should be hiding scroll bars.

As for forcing the scroll bars to appear in webpage elements, simply setting CSS's overflow: scroll does the trick. That sets both vertical and horizontal scrollbars to always appear, and it's pretty obvious when they don't have anything to scroll.

If you only want it to ever scroll vertically or horizontally, and not have the other dimension's scrollbar appear, you can use overflow-y: scroll or overflow-x: scroll respectively, instead of overflow: scroll. This works in all modern browsers, though not in IE8 and less.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文