2012-07-25 26 views
2

我嘗試在.example元素淡出這是隱藏的使用:在點擊事件中使用jquery隱藏文本?

.example { 

    display: none; 

} 

的JavaScript:

$('.clickme').click(function() { 
    ..... 
    .... 

$el.html(html).children().hide().each(function(i, e){ 
    if($(this).hasClass('special')){ 
     $(this).delay(i*600).show(0); 
     animateDiv(e.id); 
    } 
    else{ 
     $(this).delay(i*600).fadeIn(900); // the problem is here its not fading in 
    } 

工作示例是在這裏:http://jsfiddle.net/6czap/19/

我CNT似乎發現了什麼問題是,我已經嘗試了這個沒有點擊事件,它的工作原理。

回答

0

在更改.example div的內容後,添加.show()。

$el.html(html).show()... 

Working Example

0

您需要從div中刪除example類,否則它將不會顯示內容。見updated jsFiddle

$el.removeClass("example").html(html).children().hide().each(...)