简体   繁体   中英

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. 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

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

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

for a complete solution some more part of the code will be required.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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