如何使@keyframes里面的屬性值為動態添加


angular.module('analysis.realtime')
    .controller('userActionController', ['$rootScope','$scope', 'realtimeService', function($rootScope,$scope,realtimeService) {
        var mpId = $rootScope.mpId;
        var count = 1;
        $scope.headerInfo = {
            title: '實時用戶行為',
            tip: '上一個 5min 區間內, 用戶訪問網站不同的頁面情況'
        };
        realtimeService.getUserBehavior(mpId).then(function(json) {
            $scope.data = json;
            var jsonLength = json.length;
            var topLength = -jsonLength*40+40;
            var liLength=-jsonLength*40;
            $scope.textStyle={
            	'top':liLength+'px',
                'font-size': '12px',
    		'font-family': '微軟雅黑',    
    		'padding': '10px',
    		'position': 'relative',
            	'animation': 'slide 1000s linear infinite',
            	'height':'40px'
            };
           var style = document.createElement('style'); style.type = 'text/css'; var keyFrames = '\ @-webkit-keyframes slide{\ 0% {\ top: '+topLength+'px;\ }\ 100% {\ top: 40px;\ }\ }'; style.innerHTML = keyFrames; document.getElementsByTagName('head')[0].appendChild(style);
        });

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM