JQuery故障排除:我试图让我的div反向.slideup()

时间:2012-12-26 06:10:24

标签: jquery jquery-ui

http://jsfiddle.net/GwBuj/1061/

我不知道为什么这不起作用。我一直坚持这个问题。

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 个答案:

答案 0 :(得分:1)

您的代码使用Jquery UI方法,包括下面的脚本(在调用jquery脚本之后)并且它应该可以工作

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

我尝试过它有效!

编辑:具体来说,缓动方法(向下滑动)包含在你需要引用的jquery ui脚本中。