javascript - Parent sets relative positioning. Child elements are set to absolute positioning. The child element contains a floating table, and the height cannot be adapted at this time.
仅有的幸福
仅有的幸福 2017-07-05 10:48:58
0
2
831

1, implement carousel on table, so float is used, and tr in each table is different. The height changes with the table. The parent uses overflow:hidden and is relatively positioned. Please tell me how to achieve high adaptability.

2. How to get the height of the currently displayed table during carousel? ? ?

        .aircontent{
            position: relative;
            width: 980px;
            min-height: 580px;
            overflow: hidden;
        }
        .airlist{
            position: absolute;
            width: 2940px;
        }
        .airlist table{
            float: left;
            width: 980px;
        }
<p  class="aircontent">
    <p  class="airlist" style="left: 0px;">
        <table >
                   
        
仅有的幸福
仅有的幸福

reply all(2)
为情所困

It can be solved with JS.

phpcn_u1582

.....You have already positioned it absolutely and naturally you cannot get the height.
The suggestion is still $('.aircontent')css({aircontent:$('.airlist').height() + 'px'}):

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!