Commit aafb67fd authored by fred's avatar fred
Browse files

move ticker code to init(), so it works after page changes

parent 77641ac8
...@@ -145,6 +145,7 @@ $(function() { ...@@ -145,6 +145,7 @@ $(function() {
var timer = null, var timer = null,
interval = 5000; interval = 5000;
var ticker_interval = null;
/* /*
//TODO: mini icon version for player, (playpause only) //TODO: mini icon version for player, (playpause only)
$('#togglePlayer').on('click',function(e) { $('#togglePlayer').on('click',function(e) {
...@@ -369,6 +370,22 @@ $(function() { ...@@ -369,6 +370,22 @@ $(function() {
if ($('input#id_q').val() == '') { if ($('input#id_q').val() == '') {
$('input#id_q').focus(); $('input#id_q').focus();
} }
$('#ticker li:not(:first)');
if (ticker_interval) clearInterval(ticker_interval);
function tick(){
$('#ticker li:first').animate({'opacity':0}, 200, function () {
$(this).appendTo($('#ticker')).css('opacity', 1);
});
}
$("#roller button").on('click',function(e){
clearInterval(ticker_interval);
e.preventDefault();
$($(this).attr('data-about')).prependTo('#ticker');
return false;
});
ticker_interval = setInterval(function(){tick(); }, 20000);/**/
} }
init(); init();
}); });
...@@ -32,23 +32,5 @@ ...@@ -32,23 +32,5 @@
</ul> </ul>
<style> <style>
</style> </style>
<script>
$(function() {
$('#ticker li:not(:first)');
var ticker_interval;
function tick(){
$('#ticker li:first').animate({'opacity':0}, 200, function () {
$(this).appendTo($('#ticker')).css('opacity', 1);
});
}
$("#roller button").on('click',function(e){
clearInterval(ticker_interval);
e.preventDefault();
$($(this).attr('data-about')).prependTo('#ticker');
return false;
});
ticker_interval = setInterval(function(){tick(); }, 20000);/**/
});
</script>
</div> </div>
</div> </div>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment