单击网页中的左/右导航按钮时,如何将缩略图偏移固定数量(例如 5)?
有人可以指导我创建用于本网站缩略图库的导航(左侧和右侧)吗? http://office.microsoft.com/en-us/images/
基本上我希望左右按钮将缩略图偏移某个数字(如本例所示为 6)。
我不需要花哨的淡入或滑入/滑出效果,只需一个简单的导航来完成偏移部分。
我对 JS 完全陌生。
谢谢。
Could someone please guide me create the navigation (left and right) used for thumbnail gallery in this site -
http://office.microsoft.com/en-us/images/
Basically I want the left and right buttons to offset the thumbnails by some number (say 6 as in this example).
I do not want fancy fade in or slide in/out effects, just a simple navigation to do the offsetting part.
I'm totally new to JS.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如您所说,您对 JS 完全陌生,这可能很难完成,但我建议您考虑使用最常见的 JS 框架之一,jQuery。 jQuery 使构建 JS 变得更快,也更容易,另一个好处是有多个 jQuery 插件已经解决了你的问题。
就像您的情况一样,(MB)SCROLLABLE 插件可能会对您有很大帮助,您会在此站点上找到有关如何使用它的示例:http://pupunzi.com/#mb.components/mb.scrollable/scrollable.html
希望这可以帮助您入门。
As you state your totaly new to JS this might be hard to accomplish but I would suggest you look at using one of the most common JS frameworks availble, jQuery. jQuery makes building JS a lot faster but also a lot easier, and another bonus is there are multiple plugins for jQuery that has already solved your problem.
Like in your case the (MB)SCROLLABLE plugin would probably help you a lot and you'll find examples on how to use it on this site: http://pupunzi.com/#mb.components/mb.scrollable/scrollable.html
Hope that could get you started.