2017-06-02 62 views
-1

我正在創建一個網站,我必須點擊一個按鈕才能打開視頻。它曾經工作,但現在它不再了。我是否意外刪除或改變了某些內容?視頻不再開始播放

這裏是我的代碼:

HTML:

textbela.style.opacity=0; 
 
av1.onmouseover = function(){ 
 
    TweenMax.to (textbela,0.69,{opacity:1}) 
 
    TweenMax.to (vid1,0.66,{height:"100%"}) 
 
} 
 

 
av1.onmouseout = function(){ 
 
    TweenMax.to (textbela,0.69,{opacity:0}) 
 
    TweenMax.to (vid1,1,{height:"10%"}) 
 
} 
 

 
av1.onclick = function(){ 
 
    TweenMax.to ($(".button"),1,{opacity:0,onComplete:fct}) 
 
    function fct(){ 
 
    vid.style.display="block" 
 
    vid.play(); 
 
    } 
 
}
#av1{ 
 
    position:absolute; 
 
    left:5%; 
 
    background:url(previews/av1.jpg) 70% 50%; 
 
    background-size:cover; 
 
    height: 40%; 
 
    width: 40%; 
 
    border: solid; 
 
    border-width: 2px; 
 
    border-color: #000; 
 
} 
 

 
#vid1{ 
 
    position:absolute; 
 
    top:0; 
 
    background-color: #000; 
 
    height: 25px; 
 
    width: 100%; 
 
} 
 

 
#vid1 p{ 
 
    color:#F3EBEB; 
 
    font-size:16px; 
 
    text-align:center; 
 
    margin-top:0px; 
 
} 
 

 
#vid { 
 
    display:none; 
 
    position:absolute; 
 
    height:90%; 
 
    width:100%; 
 
} 
 

 
#av1:hover{ 
 
    cursor: pointer; 
 
} 
 

 
#av1:hover #textbela{ 
 
    color: white; 
 
    transition-delay: 0.7s; 
 
    transition: 0.69s; 
 
} 
 

 
#textbela{ 
 
    font-family: avenir light; 
 
    font-size: 16px; 
 
    color: transparent; 
 
    text-align: center; 
 
}
<video id="vid"> 
 
    <source src="Bela Lugosi's Dead.mp4" type="video/mp4"> 
 
</video> 
 

 
<div class="button"> 
 
    <div id="av1"> 
 
     <div id="vid1"> 
 
      <p>Bela Lugosi's Dead</p> 
 
      <div id="textbela">J’ai réalisé le clip de la chanson 「Bela Lugosi’s Dead」 de Bauhaus. La chanson parle de Bela Lugosi, l’acteur ayant incarné Dracula pour la première fois dans le film de 1931.</div> 
 
     </div> 
 
    </div> 
 
</div>

感謝您的幫助!

回答

0

「我是否意外刪除或改變了某些內容?」所有的跡象都指向「是」。

(你永遠不會在你的av1.onclick定義「VID」;可能是你曾經有過在那裏var vid = $('#vid'))再次

+0

作品,謝謝! :-D –