jQuery 解决方案,用于在发布 ~ 到 Facebook 之前对缩略图进行分页
有人有建议如何做到这一点吗?
我的视图中有一个包含图像 URL 的数组,就像
Array
(
[0] => http://i2.cdn.turner.com/cnn/2011/CRIME/06/18/florida.casey.anthony.trial/t1main.anthony.os.jpg
[1] => http://i2.cdn.turner.com/cnn/2011/images/06/18/c1main.black.hole.nasa.cxc.jpg
[2] => http://i2.cdn.turner.com/cnn/2011/LIVING/06/16/texas.veterans.legacy/tzvids.price.courtesy.jpg
[3] => http://i2.cdn.turner.com/cnn/2011/LIVING/06/18/pet.road.trips.rs/tzvids.pet.road.trip.jpg
[4] => http://i2.cdn.turner.com/cnn/2011/SHOWBIZ/06/17/photos.reynolds.auction/tzvids.monroe.dress.nca.jpg
[5] => http://i2.cdn.turner.com/cnn/2011/images/06/18/tzvids.grill.cnn.jpg
)
我想知道是否有一个 jQuery 插件可以让我模仿 FB 的功能,其中可以翻阅缩略图,并且在提交时当前活动的图像与帖子一起保存。
任何建议——即使是部分解决方案或路线图——都将受到高度赞赏。
_
Does anyone have suggestions how to do this?
I have an array in my view with the image URLs, like
Array
(
[0] => http://i2.cdn.turner.com/cnn/2011/CRIME/06/18/florida.casey.anthony.trial/t1main.anthony.os.jpg
[1] => http://i2.cdn.turner.com/cnn/2011/images/06/18/c1main.black.hole.nasa.cxc.jpg
[2] => http://i2.cdn.turner.com/cnn/2011/LIVING/06/16/texas.veterans.legacy/tzvids.price.courtesy.jpg
[3] => http://i2.cdn.turner.com/cnn/2011/LIVING/06/18/pet.road.trips.rs/tzvids.pet.road.trip.jpg
[4] => http://i2.cdn.turner.com/cnn/2011/SHOWBIZ/06/17/photos.reynolds.auction/tzvids.monroe.dress.nca.jpg
[5] => http://i2.cdn.turner.com/cnn/2011/images/06/18/tzvids.grill.cnn.jpg
)
I wonder if there is a jQuery plugin that would allow me to mimic FB's functionality in which one can page through the thumbnails, and when submitting the currently active image is saved with the post.
Any suggestions -- even a partial solution or roadmap -- are greatly appreciated.
_
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该始终考虑到并非所有用户都启用了 JavaScript 这一事实。为了适应这些用户,您应该尝试以某种方式构建应用程序,以便始终有某种 HTML 回退来为可能禁用 JS 或不可用的用户提供服务。
一种具有
noscript
回退以及以表单发送数据的能力的方法:http ://jsfiddle.net/niklasvh/5cnxh/
You should always take into account the fact that not all of your users may have JavaScript enabled. To accomodate those users, you should try and build your applications in a way that there is always some sort of HTML fallback there to serve the users who may have JS disabled or not available.
One approach with
noscript
fallback as well as the ability to send the data in a form:http://jsfiddle.net/niklasvh/5cnxh/
有两种选择:自己做,或使用插件。
这基本上是一个图像轮播,所以 jcarousel 或类似的可以工作。只需不进行过渡并一次显示一张图像即可。
要直接执行此操作,请使用 CSS 绝对定位将所有图像元素堆叠在一起。要么隐藏除一个之外的所有内容,要么将活动放在较高的 Z-index 上。绑定下一个/上一个以循环其中一个可见。
There are two options: do it yourself, or use a plugin.
This is basically an image carousel, so jcarousel or similar would work. Just give it no transition and show one image at a time.
To do it directly, stack all the image elements on top of each other with CSS absolute positioning. Either hide all but one, or give the active on higher Z-index. Bind next/prev to cycle through which one is visible.
你可以这样做:http://jsfiddle.net/9vjyP/。我认为这是不言自明的。
You could do something like this: http://jsfiddle.net/9vjyP/. I think it is rather self-explanatory.