cms/app-client/app/components/player-component.js
changeset 306 3fccf43160a7
parent 302 973df1349591
child 345 4b66390442fd
equal deleted inserted replaced
305:ff6cf3fc5f40 306:3fccf43160a7
    73         var text = jElement.find('span');
    73         var text = jElement.find('span');
    74         text.stop(true);
    74         text.stop(true);
    75         text.css('text-indent', '0px');
    75         text.css('text-indent', '0px');
    76         if(text.width() > jElement.width()) {
    76         if(text.width() > jElement.width()) {
    77             var duration = ( ( text.width() - jElement.width() ) * 8 / 100 ) * 1000;
    77             var duration = ( ( text.width() - jElement.width() ) * 8 / 100 ) * 1000;
    78             function animate() {
    78             var animate = function() {
    79                 text.delay(4000)
    79                 text.delay(4000)
    80                     .animate({
    80                     .animate({
    81                         'text-indent': -( text.width() - jElement.width() ) + 'px'
    81                         'text-indent': -( text.width() - jElement.width() ) + 'px'
    82                     }, duration, 'linear', function() {
    82                     }, duration, 'linear', function() {
    83                         text.stop(true);
    83                         text.stop(true);
    84                         text.css('text-indent', '0px')
    84                         text.css('text-indent', '0px');
    85                         window.setTimeout(function() { animate() }, 1);
    85                         window.setTimeout(function() { animate(); }, 1);
    86                     });
    86                     });
    87             }
    87             };
    88             animate();
    88             animate();
    89         }
    89         }
    90     },
    90     },
    91 
    91 
    92     onUpdate: function() {
    92     onUpdate: function() {