Bonjour tout le monde,
j'ai posté récemment pour un sujet analogue, une solution m'avait été donné, qui fonctionnait parfaitement. Aujourd'hui, me voilà avec un autre soucis.
J'ai une fonction qui fait apparaître progressivement une image.
Celui-ci est fonctionnel, cependant j'aimerais d'abord diminuer l'opacité à 0, avant de la remonter à 1.
J'avais fait cela :
Seulement, ça ne s'exécute pas. Quelqu'un aurait-il une idée ?
Passez tous une bonne soirée
WIFI
j'ai posté récemment pour un sujet analogue, une solution m'avait été donné, qui fonctionnait parfaitement. Aujourd'hui, me voilà avec un autre soucis.
J'ai une fonction qui fait apparaître progressivement une image.
function changement1 ()
{
var objet = document.getElementById("cadre");
objet.style.background = "url(../images/slider/grand_" + min_1 + ".jpg) no-repeat";
objet.style.opacity = 0.00;
var opacity = 0.00;
var fondu = function fondue ()
{
if (objet.style.opacity != 1.00)
{
opacity = opacity + 0.05;
objet.style.opacity = opacity;
}
else
{
clearTimeout(timer);
}
};
fondu();
var timer = setInterval(fondu, 10);
}
Celui-ci est fonctionnel, cependant j'aimerais d'abord diminuer l'opacité à 0, avant de la remonter à 1.
J'avais fait cela :
function changement1 ()
{
var objet = document.getElementById("cadre");
objet.style.background = "url(../images/slider/grand_" + min_1 + ".jpg) no-repeat";
objet.style.opacity = 1.00;
var opacity = 1.00;
var apparition = appear ()
{
if (objet.style.opacity != 1.00)
{
opacity = opacity - 0.05;
objet.style.opacity = opacity;
}
else
{
clearTimeout(timer2);
}
};
apparition();
var timer2 = setInterval(apparition, 10);
var fondu = function fondue ()
{
if (objet.style.opacity != 1.00)
{
opacity = opacity + 0.05;
objet.style.opacity = opacity;
}
else
{
clearTimeout(timer);
}
};
fondu();
var timer = setInterval(fondu, 10);
}
Seulement, ça ne s'exécute pas. Quelqu'un aurait-il une idée ?

Passez tous une bonne soirée

WIFI