你好,我有这个 ajax 表单,它返回一个控制“发送”动画的脚本。然而,当淡入开始时,它会以 0.1 的不透明度停止。我不确定脚本中有什么问题。任何帮助,将不胜感激。
quote_form = document.getElementsByClassName('quote-form')[0];
var timer = setInterval(function () {
if (!quote_form.style.opacity) {
quote_form.style.opacity = 1;
}
if (quote_form.style.opacity > 0) {
quote_form.style.opacity -= 0.1;
} else {
clearInterval(timer);
quote_form.innerHTML = '<p>Thank you for answering this graphic design quote questionnaire! You should receive a confirmation email shortly</p>'
var timer2 = setInterval(function () {
if (quote_form.style.opacity != 1){
quote_form.style.opacity += 0.1;
} else {
clearInterval(timer2);
}
}, 50);
}
}, 50);
控制台中没有显示错误。您可以在此页面尝试代码:
https://tester.desertsunstudio.com/el-paso-graphic-design-quote-texas-southwest-united-states-web-developer-graphic-designer-desert-sun-studio
哈士奇WWW
相关分类