poniżej przykładowy kod js. wszystko działa jak należy z wyjątkiem countdown ( linia 19 się zaczyna ten fragment kodu ), ma odliczać od 10. w tej postaci w div wpisuje mi się 1 i jedzie w dół. dlaczego?
na 100% coś mi się tu kłóci bo jak usunę wszystko i zostawię linijki od 19-26 ładnie odlicza od 10.
$(document).ready(function () { // set focus on input type text field $('#scanned_barcode').focus(); // close message box $('#closemessage').click( function () { $(this).parent('div').fadeOut('slow'); }); //auto hide information div setTimeout(function() { $('.information').fadeOut('slow'); }, 12000); // reload page every minute //setInterval("location.reload(true)", 30000); var address = "location.href='<?php echo base_url(); ?>production_statistic.screen.html'"; setInterval(address, 240000); // how many seconds to switch the screen var count = 10; id = setInterval(function(){ $('#countdown').html(count); count--; }, 1000); //progress bar animation var ex1running = false; if(!ex1running) { ex1running = true; var $this = $(this); var count = 0; var inter = null; function run() { $this.find('.meter-value').css('width', count+"%"); $this.find('.meter-text').text("Efektywność = " + count + "%"); if(count == parseInt( $('#get_value_progress').text() )) { clearInterval(inter); ex1running = false; } count++; } inter = setInterval(run, 50); } });