1. Imite desaparecer em (), desbotado ().
Princípio: SetInterval ("opacidade ++ transparência", intervalo de tempo)
var alpha = 0; function play () {timer = setInterval (function () {alpha + = 2; alfa> 100 && (alfa = 100); aimg [index] .style.Opacity = alpha / 100; AIMG [index] .style.filter = "alpha (opacity =" + alpha / 100; ClearInterval (Timer);}, 40)}2. Obtenha e defina o valor do atributo do objeto elemento:
Pontos -chave: obj.currentStyle [att]; getComputedstyle (obj, null) [att];
função css (obj, att, val) {switch (argumentos.length) {case 2: if (typeof argumentos [1] == "string") {return obj.currentStyle? obj.currentStyle [att]: getComputedStyle (obj, null) [att];} else {for (var i em att) {obj.style [i] = att [i];}} quebra; case 3: obj.style [att] = valune; quebrar; default: alert ("error;O acima exposto é o conteúdo relevante do código de função JS destaca a você pelo editor. Espero que seja útil para você!