如何设置链接菜单的样式以进行过滤,如“Dean”? 朋友们 “只是迪恩” 《只是朋友》 Facebook 上有一个吗?
我们的电子商务网络应用程序上的几个页面允许用户过滤他们提交给我们的请求的状态列表。
过滤器通常类似于:
所有待处理已完成
我们将它们设置为链接。 我们希望对它们进行样式设置,以便当前活动的过滤器用彩色矩形(带圆角,当然!)突出显示,并且文本变为白色。
矩形突出显示将一直保留,直到用户单击其他过滤器之一(待定、已完成),此时突出显示将移动到刚刚单击的链接。
Facebook 上的多个位置都显示了这样的示例,例如,墙上的帖子被过滤为:
Dean+Friends Just Dean Just Friends
是否有一种简单的方法可以在 CSS 中执行此操作,也许可以通过对最近“访问”的样式进行样式化链接但将以前访问过的链接标记为未访问过?
谢谢,
迪恩·理查森
Several pages on our e-commerce web app allow users to filter a status list of requests they've submitted to us.
The filters are usually something like:
All Pending Completed
We have them set up as links. We'd like to style them so that the currently active filter is highlighted with a colored rectangle (w/rounded corners, natch!) and the text becomes white.
The rectangular highlight would remain until the user clicked one of the other filters (Pending, Completed) at which point the highlight would move to the link just clicked.
An example of this shows up in several places on Facebook where, for example, wall posts are filtered into:
Dean+Friends Just Dean Just Friends
Is there a straightforward way to do this in CSS, perhaps by styling the most-recently 'visited' link but marking previously-visited ones as unvisited?
Thanks,
Dean Richardson
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法使用纯 CSS 产生这种动态效果。 Facebook 通过添加带有 Javascript 的 CSS 类来实现这一点,当您单击其中一个药丸选项卡按钮时,该类就会触发。 CSS 类包含使其以所需方式显示的样式规则。
You can't produce the dynamics of this effect with pure CSS. Facebook does it by adding a CSS class with Javascript that fires when you click one of the pill-tab buttons. The CSS class contains style rules that make it appear in the desired manner.