this _scrollTitle function function scrollMe if scrollMe stop return v

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
this._scrollTitle = function() {
function scrollMe() {
if (scrollMe.stop)
return;
var left = (scrollMe.counter % 2 == 0) ? '-'+offset+'px' : '0px';
title.animate({
left: left
}, duration, 'linear', function() {
scrollMe();
});
scrollMe.counter++;
}
var title = $('span.playlist-name');
var title_container = $('#playlist-title');
scrollMe.stop = true;
var scroll_speed = 25; // Скорость скроллинга (ms/px)
var title_container_width = title_container.outerWidth();
var title_width = title.outerWidth();
var offset = title_width - title_container_width;
var duration = scroll_speed * offset; // Продолжительность анимации
if (offset > 0) {
scrollMe.counter = 0;
scrollMe.stop = false;
scrollMe();
}
};