You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
-
- let video1 = document.getElementById("video1");
- let video2 = document.getElementById("video2");
- video1.play();
- window.onscroll = function () {
- var t = document.documentElement.scrollTop || document.body.scrollTop; //变量t就是滚动条滚动时,到顶部的距离
-
-
- console.log(video2.pause);
-
- // video2.pause()
- if (t < 700) {
- video2.pause();
- video1.play();
- } else if (t >= 700) {
- video1.pause();
- video2.play();
- }
-
- }
|