Last active
December 17, 2015 10:19
-
-
Save kaumac/5593951 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.trocaBanner = function(diaInicial,horaInicial,minutoInicial,diaFinal,horaFinal,minutoFinal,novaImagem){ | |
var dia = new Date(), | |
diaAtual = dia.getDay(), | |
horaAtual = dia.getHours(), | |
minutoAtual = dia.getMinutes(), | |
diaDaSemana = [ | |
'Segunda', | |
'Terca', | |
'Quarta', | |
'Quinta', | |
'Sexta', | |
'Sabado', | |
'Domingo' | |
], | |
diaDaSemana = diaDaSemana[diaAtual-1]; | |
if(diaDaSemana == diaInicial && horaAtual >= horaInicial && minutoInicial >= minutoAtual || diaDaSemana == diaInicial && horaAtual > horaInicial || diaDaSemana == diaFinal){ | |
$(this).attr('src','urlbase/'+novaImagem); | |
console.log('teste'); | |
} | |
} | |
$('.resultado-anterior').trocaBanner( | |
'Quinta', | |
15, | |
20, | |
'Sexta', | |
'imagem.jpg' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment