2015-07-19 115 views
0

我無法弄清楚它有什麼問題..它以前工作得很好,我現在沒有改變它以使它突破.. jQuery應該是正確的,並且cdn也能工作。爲什麼我的jQuery fadeOut不工作?

檢查我的筆:http://codepen.io/mathiasvanderbrempt/pen/oXMJRr

HTML:

<div class="header"> 
    <p class="covertxt">INTERIEURINRICHTING <br> & SCHRIJNWERKERIJ</p> 
</div> 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> 

CSS:

.header { 
    background:#333; 
    z-index: 5; 
    margin: 0 auto; 
    width: 80%; 
    max-width: 500px; 
    top: 30vh; 
    /*absolute centering*/ 
    position:absolute; 
    left:0; 
    right:0; 
    margin-left:auto; 
    margin-right:auto; 
    text-align: center; 
    color: #fff; 
} 

.header img { 
    width:100%; 
} 

.header p { 
    font-size: 22px; 
    font-family: montserratlight; 
    letter-spacing: 0.4em; 
    line-height: 1.3em; 
    text-transform: capitalize!important; 
    cursor: default; 
    text-align: center; 
    -webkit-transition: all 1.25s ease-in-out; 
    -moz-transition: all 1.25s ease-in-out; 
     -ms-transition: all 1.25s ease-in-out; 
     -o-transition: all 1.25s ease-in-out; 
      transition: all 1.25s ease-in-out; 
} 

的jQuery:

$(document).ready(function() { 
    var delay = 3000; //3 seconds 
    setTimeout(function() { 
    $('.header p').fadeOut(300, function() { 
     $(this).text("A LIFESTYLE FOR EVERYONE").fadeIn(300); 
    }); 
    }, delay); 

    console.log("replaced"); 
}); 

回答

1

我不完全確定你要做什麼,但註釋掉所有xxx-transition屬性會使文本消失。

查看修正pen