我如何让“Facebook Zoom”变成“Facebook 缩放”?
我正在制作一个网站,我喜欢这个 google chrome 扩展调用 Facebook Photo Zoom @ https:/ /chrome.google.com/extensions/detail/elioihkkcdgakfbahdoddophfngopipi
我认为该扩展背后的基本思想是,当您将鼠标悬停在缩略图上时,它会抓取原始图像文件并以完整视图显示它。如果图像太大,那么它将位于窗口的角落或顶部和底部栏上。如果不是太大,它会漂浮在鼠标位置旁边。
我理解其背后的逻辑,但实际编码似乎有点令人畏惧。我想我唯一不明白的部分是如何对扩展图像的位置进行编码,并在将鼠标向左/右移动时使它们收缩/扩展。谢谢
Im making a website, and i love the functionality of this google chrome extension call Facebook Photo Zoom @ https://chrome.google.com/extensions/detail/elioihkkcdgakfbahdoddophfngopipi
I think the essential idea behind the extension is when you hover over the thumbnail, it grabs the original image file and displays it in full view. If the image is too big, then it will be position on the corners or the top and bottom bars of the window. If it is not too big, it will float next to the mouse position.
The logic behind it i understand, but the actually coding seems to be a bit daunting. I guess the only parts of it i dont understand is how do you code the positions of the expanded images and make them contract/expand when you move your mouse to the left/right. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这里有 13 个缩放 jquery 插件。选择最适合您需求的:)
13 zoom jquery plugins in here. Choose the best for your needs:)
创建大图像
在 鼠标悬停 上,您可以在 mousemove 您以相同的方式更新左侧和顶部。
另请检查:
on mouseover you create big image with
on mousemove you update the left and top in the same way.
check also:
查看这个预览图像工具提示,它与 Chrome 扩展程序的功能类似,但您必须向其提供缩略图和全尺寸图像的 URL。这是原始的博客文章。
我修改了脚本以调整图像大小以适合光标和浏览器右边缘之间的距离。它并不完美,但它有效。这是一个演示。
Check out this preview image tooltip which is similar to what that Chrome extension does, but you have to provide it the url to the thumbnail and full sized image. Here is the original blog post.
I modified the script to adjust the image size to fit the distance between the cursor and right browser edge. It's not perfect, but it works. Here is a demo.
请参阅 Kabbar 图像缩放器 http://www.ideabonus.com/Kabbar/index.html
See the Kabbar Image Zoomer at http://www.ideabonus.com/Kabbar/index.html