photoswipe 从 flickr 或其他 feed 获取图像?
我正在使用 photoswipe 并看到了可用的示例,但那里没有任何动态。
有没有人设法从 Flickr 或其他提要中获取 photoswipe 抓取图像,或者知道任何地方的任何示例?
这是示例网址:
[http://www.photoswipe.com/latest/examples/04-jquery-mobile.html][1]
I am working with photoswipe and seen the examples available but there's nothing dynamic there.
Has anyone managed to get photoswipe grabbing images from Flickr or other feed or know of any examples anywhere?
Here's the examples url:
[http://www.photoswipe.com/latest/examples/04-jquery-mobile.html][1]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我创建了一个脚本,该脚本使用 Flickr API 和 Photoswipe 将 flickr 设置显示为幻灯片。它尚未完全完善,但非常简单且可用。只需输入您的 flickr api 密钥并设置 ID,它就会完成剩下的工作。
https://github.com/lyoshenka/photoswipe-flickr
I created a script that uses the Flickr API and Photoswipe to show a flickr set as a slideshow. It's not fully polished yet, but very simple and usable. Just enter your flickr api key and set id, and it does the rest.
https://github.com/lyoshenka/photoswipe-flickr
我在我的博客上(并在博客中简要介绍了它的工作原理此处)。我将跳过 photoswipe 的基本安装,您可以从他们的教程中获得该安装。这是我用来访问 flickr 的代码:
将其放在文档中的适当位置。对我来说,这只是在 body div 中。
下面是更复杂的部分——一些 javascript 来处理来自 flickr 的 JSON feed。这是改编自 viget.com 的旧教程。请注意,我已对其进行了调整,以设置一个变量来检测视网膜与非视网膜显示器,并自动计算从 flickr 返回的照片数量。使用以下脚本创建一个文件,并在您的 PhotoSwipe 页面上链接到该文件。
基本上就是这样。它将 q 的内容写入到页面中放置上述
的位置。 q 包含“视网膜”缩略图和图像或“标准”缩略图和图像。虽然这里和那里有点笨拙,但效果很好。
根据您的特定需求进行定制和/或删除视网膜检测等应该非常简单。
I have this working on my blog (and blogged about how it works briefly here). I'll skip over the basic installation of photoswipe, which you can get from their tutorials. Here's the code I used to access flickr:
Place this in your document in the appropriate spot. For me, that's just in a body div.
The more complicated part is below -- some javascript to handle the JSON feed from flickr. This was adapted from an older tutorial from viget.com. Note that I've adapted it to set a variable to detect retina vs non-retina displays and also to automatically count the number of photos returned from flickr. Create a file with the script below and link to it on your PhotoSwipe page(s).
That's basically it. It writes the contents of q into wherever you placed the above
<script>
into the page. q contains either a 'retina' thumbnail and image or a 'standard' thumbnail and image. Its a little kludgy here and there, but works fine.It should be pretty trivial to customize to your specific needs and/or remove retina detection, etc.