如果在眼前,做点什么

编程入门 行业动态 更新时间:2024-10-24 08:19:08
本文介绍了如果在眼前,做点什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个滑块.它可以对图层内部的事物进行动画处理.它还会为图层设置动画.所以;我想要的是当视频层出现时,它可以从滑块区域之外为视频本身设置动画;我需要做点什么.

I have a slider. It animates things inside of layers. It also animates layers. So; what i want is when video layer comes sight, and it animates video itself from out of slider area; i need to do something.

这是我到目前为止所做的.但这是行不通的.

This is what i have done so far. But it doesn't work.

if ($(".homeBannerVideoBg").live().is(":inView")) { $("body").addClass("YEEHA"); } else { $("body").addClass("VUUHUU"); }

homeBannerVideoBg是我的视频元素.

homeBannerVideoBg is my video element.

我可以在这里帮忙吗?

推荐答案

github/protonet/jquery.inview

有一个很棒的插件,用于确定当用户滚动页面时元素何时进入视图.它采用事件的形式,因此您可以使用回调来执行操作,就像您单击单击"一样

There's a great plugin, for determining when an element comes into the view when the user scrolls through the page. It takes the form of an event, so you can use a callback to perform your actions, just as you would a "click"

更多推荐

如果在眼前,做点什么

本文发布于:2023-10-18 10:46:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504007.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:做点什么   在眼前

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!