Jquery 图像在淡入淡出时丢失,求助!
我最近启动了我的作品集页面,我使用 jquery 插件根据它们的类别对我的作品集条目进行排序。请查看此处
您会注意到,当您将鼠标悬停在每个图像上时,它会放大并显示案例研究链接向上。它应该是这样的。当您按下徽标时,品牌按钮(顶部)它的功能也很完美。 但是,按任何其他按钮,然后滚动图像。它消失了!使该图像恢复的唯一方法是返回到“全部”或“徽标和品牌”部分并翻转丢失的图像。
我似乎无法弄清楚为什么其中一些有效而大多数无效。代码看起来是一致的,但也许我遗漏了一些东西。谢谢。
I Recently launched my portfolio page, and I used a jquery plugin to sort my portfolio entries based on their classes. Please view it Here
You will notice that when you rollover each image, it enlarges and a case study link shows up. That is how it should look. When you press on the logos & branding button (up top) it functions perfectly as well. BUT, press any of the other buttons and then scroll over an image. It disappears! The only way to make that image come back, is to return back to the "all" or "logos & branding" section and rollover the missing image.
I cant seem to figure out why some of it is working and most of it isn't. The code seems to be consistent, but maybe I am missing something. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发生这种情况是因为您从找到的第一个 .zitem 计算宽度和高度
当第一个项目被隐藏(由于过滤)时,其显示设置为无,因此其宽度和高度变为 0。
您将需要读取第一个像这样读取高度/宽度时可见的 .zitem
在取消缩放图像时会执行相同的操作
This happens because you calculate the width and height from the first .zitem you find
When the first item is hidden (due to the filtering) its display is set to none, so its width and height become 0.
you will need to read the first visible .zitem when reading the height/width like this
do the same thing when you unzoom the image