CSS3如何在Google Chrome的表格的tbody元素上放置左滚动条? [英] CSS3 How do I position a left scrollbar on a tbody element of a table for google chrome?

查看:335
本文介绍了CSS3如何在Google Chrome的表格的tbody元素上放置左滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经调查这个问题,找不到解决方案。
网站是一个RTL网站,所以我想要左侧的滚动条。
我看到一些hack可以得到这个,除非我真的需要它。

I have looked into this issue and can not find a solution. The web site is a RTL site so I would like the scrollbars on the left. I have seen some hacks that can get this done except where I really need it.

表的Tbody元素需要向下滚动,没有标题行消失。
我可以得到滚动条的右侧,但不知道如何将它向左移动。

The Tbody element of the table needs to scroll down without the header row disappearing. I can get the scrollbar on the right hand side of the tbody but have no idea how to move it to the left.

任何想法如何获得

我很幸运,它只能在Google Chrome上工作。

I am lucky it only has to work on Google Chrome.

感谢

推荐答案

无法使用CSS进行更改。例如,有没有滚动条的浏览器(iPhone,ANdroid)。滚动条的位置完全取决于用户的系统,而不是网页。

It can't be changed with CSS. For example, there are browsers (iPhone, ANdroid) that don't have scroll bars. The scroll bar position depends entirely on the user's system, not the web page.

您可以使用Javascript来模拟您想要的。

You can use Javascript to imitate what you want. Make a draggable scroll bar replacement, place it on the left, and adjust the hidden overflow according while the user drags the "scrollbar".

尝试搜索jquery scrollbar,然后将其拖动到或javascript scrollbar。

Try googling for "jquery scrollbar" or "javascript scrollbar".

这是一个有趣的替代滚动...拖动(类似于如何在谷歌地图中拖动地图):
http://plugins.jquery.com/project/MapScroller

Here's a an interesting alternative to scrolling... Dragging (similar to how you drag maps in google maps): http://plugins.jquery.com/project/MapScroller

另一种方法是,计算用户滚动条的宽度的脚本:
http://plugins.jquery.com/project/ba-jquery-scrollbarwidth-plugin
你可以计算宽度,然后隐藏滚动条overflow:hidden然后在左边添加一个div,与要滚动的框的高度相同,并且宽度与用户的滚动条相同,然后编写一个脚本,将右边框滚动到与左边相同的位置,从而模仿内置系统滚动条。

And yet another alternative, here's a script that calculates the width of the users scroll bar: http://plugins.jquery.com/project/ba-jquery-scrollbarwidth-plugin You can calculate the width, then hide the scroll bar with overflow:hidden then add a div on the left with same height as the box you want to scroll and same width as the user's scrollbar, then write a script that scrolls the right box to the same position as the one on the left, thus imitating built in system scrollbars.

有无尽的可能性,只需使用google来找到你所需要的并获得创意。 ;)

There's endless possibilities, just use google to find what you need and get creative. ;)

但是,我认为这正是你要找的:
http://baijs.nl/tinyscrollbar/
从示例中可以看到,滚动条由元素组成。

But, I think this is exactly what you're looking for: http://baijs.nl/tinyscrollbar/ As you can see in the examples, the scrollbar is made of elements. You can position them on the left if you'd like.

也许是这样的:
http://plugins.jquery.com/project/tbodyscroll
是您需要的完全。 ;)

Perhaps that, along with this: http://plugins.jquery.com/project/tbodyscroll is EXACTLY what you need. ;)

查看这个例子:
http://jsfiddle.net/trusktr/xQSxJ/

我会尽快更新有一个表只是为了我自己的锻炼。 ;)

I'll update it soon to work with a table just for my own exercise. ;)

通常情况下,你只能找到部分解决方案,并需要即兴提出一个完整和独特的解决方案。 :)祝你好运。

Often times you will only find partial solutions and will need to improvise to come up with a complete and unique solution. :) Good luck.

这篇关于CSS3如何在Google Chrome的表格的tbody元素上放置左滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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