[英]show fixed div (print) while scrolling on table
我有很長的列表數據。 在表的頂部是一個具有打印按鈕的div。 滾動時我缺少按鈕,因為按鈕在頂部。 我想在滾動時在表格的左側或右側顯示div打印嗎? 當我再次到達頂部時,它保持原樣。
是否可以使用Jquery和CSS?
<div class="row" id="printSelectedRecords">
<div class="col-md-12">
<span class="col-md-3">
<a class="btn btn-default btn-primary" ng-click="showSelectedRecords()" ng-disabled="selectedItems.length==0">
Continue to Print
</a>
</span>
</div>
</div>
<br/>
<table class="table table-bordered">
<tr>
<th></th>
<th>Printed</th>
<th>First Name</th>
<th>Last Name</th>
<th>Company</th>
<th>City</th>
<th>Country</th>
</tr>
<tr ng-repeat="item in items">
<td>
<input class="check-box" data-val="true" type="checkbox" ng-model="item.selected" ng-click="checkboxClick($event, item)">
</td>
<td>
{{item.printed}}
</td>
<td>
{{item.firstName}}
</td>
<td>
{{item.lastName}}
</td>
<td>
{{item.company}}
</td>
<td>
{{item.city}}
</td>
<td>
{{item.country}}
</td>
</tr>
</table>
您嘗試使用位置:固定在此按鈕上嗎?
您可以嘗試使用此CSS將按鈕放置在頁面右下方
.fixed-button {
position: fixed;
bottom: 0;
right: 0;
}
<div class="row fixed-button" id="printSelectedRecords">
<div class="col-md-12">
<span class="col-md-3">
<a class="btn btn-default btn-primary" ng-click="showSelectedRecords()" ng-disabled="selectedItems.length==0">
Continue to Print
</a>
</span>
</div>
</div>
如果您希望按鈕停留在頂部,則相應地更改css(頂部:0)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.