-4
<div class="container">
<label ng-repaet"x in items">{{x}}</label>
</div>
我想在容器溢出時自動將容器div的滾動條放在底部,並將標籤項添加到底部。如何在div中添加新內容時自動向下滾動到div的底部?
的DIV容器的CSS類是:
.container{
position:relative;
display:block;
overflow-y:scroll;
overflow-wrap:break-word;
height:300px;
}
,也是我有風格我的滾動條如下:
::-webkit-scrollbar{
width:6px;
}
::-webkit-scrollbar-track{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 0px;
}
::-webkit-scrollbar-thumb{
border-radius: 0px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
http://stackoverflow.com/questions/12790854/angular-directive-to-scroll-to-a-given-item試試這個 – byteC0de
它不適合我@Jimbrooism – Krisalay
我已經檢查過,它didn沒有工作。 @AlexLogan – Krisalay