Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery:在jQuery hide()完成后进行更改_Jquery_Html_Hide_Document Ready - Fatal编程技术网

jQuery:在jQuery hide()完成后进行更改

jQuery:在jQuery hide()完成后进行更改,jquery,html,hide,document-ready,Jquery,Html,Hide,Document Ready,问题是: 我想要的是,在它向下滑动(单击时滑动)后,黄色高度仅从60px更改为20px。如何修复 $(document).ready(function () { $('#slide-link').click(function(){ $(this).animate({ top: $(window).height()-40 },5000) $('#sliderWrapper').stop().hide("slide", { direc

问题是:

我想要的是,在它向下滑动(单击时滑动)后,黄色高度仅从60px更改为20px。如何修复

 $(document).ready(function ()
   {
     $('#slide-link').click(function(){
       $(this).animate({ top: $(window).height()-40 },5000)
       $('#sliderWrapper').stop().hide("slide", { direction:"down" }, 5000); 
       $('#slide-link').height(20)
      //I want 20px to become after #sliderWrapper slided down, not on click
      //That's why I put $('#slide-link').height(20) as the last line
      // But it triggers asap. How to fix?
    })
})​
据我所知,
$('#滑动链接').height(20)
不会等到
$('#滑动rapper').stop().hide(“滑动”,{方向:“向下”},5000)
完成了

另外,
$(“#滑动链接”)。延迟(5000)。高度(20)
也没有帮助。为什么?如何修复?

.delay()
仅影响使用动画队列的函数。但是,
.height()
与动画无关,因此不使用该队列

 $(document).ready(function ()
   {
     $('#slide-link').click(function(){
       $(this).animate({ top: $(window).height()-40 },5000)
       $('#sliderWrapper').stop().hide("slide", { direction:"down" }, 5000); 
       $('#slide-link').height(20)
      //I want 20px to become after #sliderWrapper slided down, not on click
      //That's why I put $('#slide-link').height(20) as the last line
      // But it triggers asap. How to fix?
    })
})​
您需要的是
.hide()
的回调,该回调在动画完成后触发:

$('#sliderWrapper').stop().hide("slide", {
    direction: "down"
}, 5000, function() {
    $('#slide-link').height(20)
});
演示:

.delay()
仅影响使用动画队列的函数。但是,
.height()
与动画无关,因此不使用该队列

您需要的是
.hide()
的回调,该回调在动画完成后触发:

$('#sliderWrapper').stop().hide("slide", {
    direction: "down"
}, 5000, function() {
    $('#slide-link').height(20)
});
演示:

如中?如中?