.keshi{
height: 164px;
overflow-y: hidden;
}
.keshi .gund {
animation: move 150s linear;
animation-iteration-count: infinite;
}
<div class="list_container">
<div class="tit_big"><b>退租企业名单</b></div>
<div style="height: 45px ;width: 100%">
</div>
<div id="IA6" class="tab_li" >
<div class="tit_IA"><div >企业名称</div><div class="tit_IA1">退租时间</div></div>
<div class="keshi2"> <div class="gund2"> <div class="list_IA" ng-repeat="(x, y) in tzlist"> <div >{{y.Name}}</div><div >{{y.value}}</div></div></div></div>
</div>
</div>
var app_list = angular.module("index_IA", []);
app_list.controller("index_IA_list", function($scope) {
ajaxCommonFunction2("zhaoShangService","getRentOutCompany","", function (str){
$scope.tzlist = str;
$scope.$apply();
setTimeout(function () {
var $container = document.querySelector('.gund');
var $conHeight = $container.scrollHeight-164;
// var $bodyHeight = $container.offsetHeight;
// var diff = Math.floor($conHeight - $bodyHeight);
// var $childs = $container.children;
// console.log($conHeight,$bodyHeight,diff)
if ($scope.dqlist.length>5){
var style = document.createElement('style');
style.type = 'text/css';
try {
style.appendChild(document.createTextNode('@keyframes move{ from { transform: translateY(0); } to { transform: translateY(-'+ $conHeight +'px); } }'))
} catch (error) {
style.styleSheet.cssText = '@keyframes move{ from { transform: translateY(0); } to { transform: translateY(-' + $conHeight + 'px); } }';
}
$container.class="gundmove";
var head = document.querySelector("head");
head.appendChild(style);}
},2000);
});
做个笔记,大哥的代码还是有点东西的