0
我一直在看這裏的幾個帖子,與此類似的問題,但沒有一個解決我的問題。溢出內容的分隔高度
我在這裏發佈HTML:
.general_scrollingContainer {
overflow-y: scroll;
padding: 0 10px;
width: 100%;
}
,並把JavaScript和調整div的可見高度來調整它的事件:
<div id="scroller" class="general_scrollingContainer" layout="column" layout-fill layout-align="top left">
<ul class="dynamic-grid" angular-grid="pics"
ag-grid-width="200"
ag-gutter-size="10"
ag-id="gallery"
refresh-on-img-load="true">
<li class="grid" ng-repeat="product in products">
<a ng-href="{{product.link_shop}}" target="_blank">
<img class="grid-img" ng-src="{{product.url_imagen}}" />
</a>
<div class="img-desc-wrap" layout="column" layout-fill layout-align="top left">
<a class="title" ng-href="{{product.link_shop}}" target="_blank" style="font-size:12px;line-height:16px">
{{product.title}}
</a>
<div class="date"><b>Category</b>: {{product.category_name}}</div>
<div class="object_icons_holder" layout="row" layout-align="space-between stretch">
<div flex layout-align="start center" layout="row">
<ng-md-icon icon="share" size="30" style="fill:#666;margin:-5px 0 0 10px" class="social_icon" aria-label="Share Product"
ng-click="showSocialShare($event, 0)">
<md-tooltip md-direction="top">
Share in Social Networks
</md-tooltip>
</ng-md-icon>
</div>
<div class="shop_price">{{product.price}}</div>
</div>
</div>
</li>
</ul>
</div>
該類general_scrollingContainer的CSS :
$(window).resize(function() {
var $main_container = $(window).height();
$(".general_scrollingContainer").css({
"height": ($main_container - 160) + 'px'
});
});
主要div' general_scrollingContainer'根據窗口高度具有固定高度,內部是溢出可見區域的元素。
問題是,我試圖在滾動到底部時需要事件,並需要包括高度不可見的div的實際高度。
使用$('div.general_scrollingContainer').innerHeight()
,只顯示DIV可見區域的高度,與$('div.general_scrollingContainer').height()
相同的值,所以我不知道如何獲得整個高度。
任何幫助?