我是AngularJS的初学者,并在我的表格中应用了dirpagination。 一切正常,只有当我通过点击目录页面按钮导航到我的表格的另一页时,首先表格的高度增加,所有行显示一秒钟,然后显示正确的范围。 我怎样才能避免这种行为? 提前致谢。
这是我的代码:
<table class="table table-hover nbt-table"> <thead> <tr> <th>heading1</th> <th>heading2</th> <th>heading3</th> <th>heading4</th> </tr> </thead> <tbody id="table1"> <tr dir-paginate="value in viralities|itemsPerPage:10" pagination-id="value-paginate"> <td><span ng-bind="value[2]"></span></td> <td><span ng-bind="value[1]"></span></td> <td>{{ value [7] | date : 'dd-MM-yyyy hh:mm'}}</td> <td>{{ value [8] | date : 'dd-MM-yyyy hh:mm'}}</td> </tr> </tbody> </table> <dir-pagination-controls pagination-id="value-paginate" class="pull-right" max-size="10" direction-links="true" boundary-links="true" > </dir-pagination-controls>I am a beginner in AngularJS and have applied dirpagination in my tables. Everything works fine except that when I navigate to another page of my table by clicking on the dir-pagination page buttons, at first the table's height increases and all the rows are shown for a second, then the correct range is shown. How can I avoid this behaviour? Thanks in advance.
Here is my code:
<table class="table table-hover nbt-table"> <thead> <tr> <th>heading1</th> <th>heading2</th> <th>heading3</th> <th>heading4</th> </tr> </thead> <tbody id="table1"> <tr dir-paginate="value in viralities|itemsPerPage:10" pagination-id="value-paginate"> <td><span ng-bind="value[2]"></span></td> <td><span ng-bind="value[1]"></span></td> <td>{{ value [7] | date : 'dd-MM-yyyy hh:mm'}}</td> <td>{{ value [8] | date : 'dd-MM-yyyy hh:mm'}}</td> </tr> </tbody> </table> <dir-pagination-controls pagination-id="value-paginate" class="pull-right" max-size="10" direction-links="true" boundary-links="true" > </dir-pagination-controls>最满意答案
通过添加以下CSS解决了这个问题 -
.table > tbody > tr { transition: background 0.0s; }这阻止了闪烁。 希望这将有助于其他初学者在解决这样的问题。 :)
Solved the issue by adding the following CSS -
.table > tbody > tr { transition: background 0.0s; }This stopped the flickering. Hopefully this will help other beginners struggling with such problem. :)
更多推荐
发布评论