gpt4 book ai didi

javascript - 液体 slider 和ajax

转载 作者:行者123 更新时间:2023-11-28 08:54:46 27 4
gpt4 key购买 nike

我正在使用带有 ajax 的 Liquid Slider,但我遇到了高度问题。

这是我的脚本:

var api2 = $.data( $('#slider-7')[0], 'liquidSlider');  $.ajax({    complete: function() {      $('#siteloader').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work1.html');      $('#siteloader2').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work2.html');      $('#siteloader3').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work3.html');      $('#siteloader4').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work4.html');      api2.adjustHeight(true, api2.getHeight());    }  });

页面已加载到 div 中,但 adjustmentHeight 无法正常工作...问题出在哪里?

谢谢

最佳答案

这样,只需将此脚本添加到您的 ajax 完整函数中即可:

var innerHeight = $('#innerElement').height();

看那个JSFIDDLE EXAMPLE

所以......你可以像这样使用这段代码:

  $.ajax({
complete: function() {
$('#siteloader').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work1.html');
$('#siteloader2').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work2.html');
$('#siteloader3').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work3.html');
$('#siteloader4').html('This JSON request was faked, and you will surely want to write a real one in it\'s place' + $('.profile').html()).load('work4.html');
api2.adjustHeight(true, $(api2).height());
}
});

希望这有帮助。

关于javascript - 液体 slider 和ajax,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18642909/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com