jQuery addClass() to another class -


i find class (used multiple td) , add @ td class, class.

the class every td $day-momento-$x ($day number of today, $x can 1, 2 or 3, because i've 3 columns).

this javascript code

var ora = new date(); oo = ora.gethours(); giorno = ora.getdate();  //console.log('oo: '+ oo + ', giorno: ' + giorno);          if (oo >= 4 && oo < 12) {             $('.'+giorno+'-giornata-1').addclass('online');          } else if (oo >= 12 && oo < 20) {             $('.'+giorno+'-giornata-2').addclass('online');          } else if (oo >= 20 && oo < 4) {             $('.'+giorno+'-giornata-3').addclass('online');          } 

php/html code

at top i've connection db, , $i of ajax code

$i = $_post['contatore_giorni'];      $numerogiorno = date("j", strtotime("+".$i." days"));      $contatore = 0;         ($m_p_s = 1; $m_p_s < 4; $m_p_s++) {             $stampa_punti .= '<td class="'.$numerogiorno.'-giornata-'.$m_p_s.'">';         [.....] 

the last if says: if number bigger 20, smaller 4 (this never happen...)


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -