我是否使用 canvas 元素或仅使用普通的 div 支架来实现带有热点的交互式图像轮播/滑块?
我需要制作一个交互式图像库(或图像滑块),其中需要放置一些热点。必须能够单击这些热点,以使用相应的信息更新侧边栏。画廊的幻灯片或场景上还必须可以有一些基本的动画。
哪种设置将是最佳解决方案。 我目前正在考虑画布元素,但缺乏绘制热点的特定事件让我怀疑。 EaselJS 可能是一个解决方案。
另一种方法是使用常规的 javascript 图片库并在其上放置一些固定位置的热点。
这实际上是一个基本的 mvc 设置,我有图片库、热点和侧边栏。 我应该使用像 http://javascriptmvc.com/ 或 backbone.js
所以我的问题实际上是,考虑到性能和一些基本动画,最好的设置是什么?
谢谢。
我发现的其他有趣的链接:
I need to make a interactive image gallery (or image slider) where some hotspots need be placed on. It has to be possible to click on those hotspots, to update a sidebar with the corresponding info. Some basic animation must also be possible on a slide or scene of the gallery.
Which setup would be the best solution.
I'm currently thinking about the canvas element, but the lack of specific events for drawn hotspots makes me doubt. EaselJS could be a solution though.
An alternative could be just using a regular javascript image gallery and place some fixed positioned hotspots on it.
This is actually a basic mvc-setup, I have the image gallery, hotspots and the sidebar.
Should I use a javascript mvc library like http://javascriptmvc.com/ or backbone.js
So my question actually is, what would be the best setup, with performance and some basic animation in mind?
Thanks.
other interesting links I found:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您要显示大图像或期望用户使用较旧的浏览器或没有当前 GPU 加速的浏览器,那么您应该始终使用标准 HTML4 元素来完成此操作。使用画布是一种过度的杀伤力,如果你对它没有太多经验的话,以后会给你带来痛苦。
对于基于 DOM 的图像,您已经有了单击事件,甚至可以使用图像映射来执行单击区域。使用画布,您需要编写自己的点击检测代码,并将鼠标位置映射到某个区域以检查点击情况。
总而言之,最简单的解决方案通常是最好的解决方案,并且为了性能和开发的便利性,我认为画布并不是前进的方向。
If you are displaying large images or expect users to have older browsers or browsers without current GPU acceleration then you should always use standard HTML4 elements to get this done. Using canvas is overkill and will cause you pain later on if you are not overly-experienced with it.
With DOM-based images you already have click events and can even use image maps to do the click-regions. With canvas you need to code your own click detection and map mouse position to a region to check for clicks.
All in all the simplest solution is usually the best one and for performance and ease of dev, canvas is not the way forward in my opinion.