简体   繁体   English

带有扩展内容的滑块,具体取决于下一张幻灯片上内容的高度,单击“更多”时,它们全部折叠

[英]slider with an expanded content depending on the height of the content on the next slide it all collapse when clicking “more”

i have a slider with content the expands with a read more toggle i have it set to expand the div according to the size of the content. 我有一个带有内容的滑块,它带有一个更多的阅读开关,可以根据内容的大小来扩展div。 the first one works great but as i advance to the next slide and click to read more to expand the whole div collapses and the height is set to 0px 第一个效果很好,但随着我前进到下一张幻灯片,然后单击以阅读更多内容以展开整个div,并且高度设置为0px

if ($(currentslide).css('display') == 'block') {
    $('#super-slideshow-2').height($(".slider_area").height() + "px");
} else if ($(currentslide).css('display') == 'none') {
    $('#super-slideshow-2').height(318);
};  

it appears that in case of next slide 看来在下一张幻灯片的情况下

$(".slider_area").height() is equal to 0. You can confirm the value by using $(".slider_area").height()等于0。您可以通过使用确认该值

console.log($(".slider_area").height());

for a complete solution some more part of the code will be required. 对于完整的解决方案,将需要更多的代码部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM