2012-12-26 22 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。 –