我正在为我的视频制作一个自定义的播放暂停按钮。但是,当我将鼠标移到按钮上时,按钮将一直闪烁。当我把鼠标移到按钮上时,你有办法停止闪烁吗?谢谢
$('#fullplay')
.mouseover(function () {
$('#playpausevideo').fadeIn();
})
.mouseout(function () {
$('#playpausevideo').fadeOut();
});.container{
}
.playpausevideo{
height:100px;
width:100px;
position:absolute;
background-image:url('/../../Images/onbigplan/bigfullplay.png');
background-repeat:no-repeat;
background-position:center;
cursor:pointer;
display:none;
background-color:#000;
z-index:99999;
}
.playpausevideo.selected{
height:100px;
width:100px;
position:absolute;
background-image:url('/../../Images/onbigplan/bigfullpause.png');
background-repeat:no-repeat;
background-position:center;
cursor:pointer;
background-color:#ff0000;
z-index:99999;
}<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<div id="playpausevideo" class="playpausevideo noselected"></div>
<video id="fullplay" autoplay muted loop poster="" width="400px" height:="300px">
<source src="http://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
<source src="http://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg" />
</video>
</div>
发布于 2015-06-12 17:39:12
您可以将视频和按钮打包到一个div中,并在该div上收听mouseenter和mouseleave事件。
下面是一个jsfiddle示例:http://jsfiddle.net/jp5ru8vz/
https://stackoverflow.com/questions/30799347
复制相似问题