识别 Galleriffic 中的活动图像
昨晚问完一个问题后,我正在将一个页面重新设计到 Galleriffic 的范围内,以利用受控图像加载的优势。要做到这一点,必须真正做到这一点。
我在识别页面上的活动图像时遇到问题。我已经来回运行了这个插件的功能很多次了,我都快哭了。从字面上看,只需要找到一个可用的 CSS 选择器,这样我就可以从中创建一个变量并操纵该图像。
奇怪的是 - 这个插件永远不会向显示的图像添加 .current
或 .active
类。所以不幸的是我必须手动执行此操作。
不管怎样,我设置了一个 jsFiddle 来演示......非常感谢所有帮助!
After a question last night, I'm reworking a page into the scope of Galleriffic to take advantage of controlled image loading.. and to do so have to really get knitty gritty.
I'm having issues identifying the active image on the page. I've run through the plugin's functions back and forth so many times I'm going to cry. Literally just need to find a working CSS Selector so that I can make a variable out of it and manipulate that image.
Oddly enough- this plugin never adds a .current
or .active
class to the image being displayed.. So unfortunately I have to do this manually.
Anyway, I set up a jsFiddle to demonstrate... All help is greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
@Evan 说的是正确的。我已经设置了一个示例,您可以根据需要修改选择器。请密切关注 JavaScript 控制台。
http://jsfiddle.net/PHSrE/2/
查看文档,我看到了此事件:<代码> onSlideChange
What @Evan said is correct. I've set up an example, you can modify the selector as you wish. Keep your eye on your javascript console.
http://jsfiddle.net/PHSrE/2/
Looking at the documentation I saw this event:
onSlideChange
页面上没有多个图像。所以你需要做的就是选择唯一的图像:
there aren't multiple images on the page. so all you need to do is select the only image:
您可以轻松找到所选的缩略图(如果有帮助):
You can easily find the selected thumbnail, if that helps: