2012-12-26 21 views
2

http://jsfiddle.net/GwBuj/1061/JQuery的故障排除:我試圖讓我的div反向.slideup()

我不知道爲什麼,這是行不通的。我一直困在這個問題上。

HTML:

<div class="step" id="firststep"> 
     <div class="stepgraphic2">fadjkfjka</div> 
    </div> 

的jQuery:

$('#firststep').click(function() { 

    alert('fjad');     
    $('.stepgraphic2').hide("slide", { direction: "down" }, 1000); 
}); 

CSS:

.step{   
    float: left; 
    height: 230px; 
    width: 230px; 
    background-color: #025588; 
    margin-top: 115px; 
    margin-right: 10px; 
    margin-bottom: 10px; 
    margin-left: 10px; 
} 
.stepgraphic2{ 
    background-color:#FFF; 
    height: 170px; 
    width: 157px;  
}​ 

回答

1

代碼使用jQuery UI的方法,包括下面的腳本(後jQuery腳本被調用)它應該工作

<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js'></script> 

我試過了,它工作!

編輯:具體的放鬆方法(向下滑動)包含在你需要引用的jquery ui腳本中。

+0

工作正常! :http://jsfiddle.net/GwBuj/1066/ – Chetan

+0

@Chetan是的,它在jsfiddle中工作正常,因爲JqueryUI庫被選中,而沒有選擇原始jsfiddle。 –