高分求以下jquery代码得详细意思解读 200
<scripttype="text/javascript">varanimElements={init:function(){functione(){vare=-1;$(...
<script type="text/javascript">
var animElements = {
init: function() {
function e() {
var e = -1;
$(".anim_emt:not(.start-animation):in-viewport").each(function() {
function t(e) {
setTimeout(function() {
n.css({
"transition-duration": e,
"-webkit-transition-duration": e
})
},
200)
}
var n = $(this),
o = n.css("transition-duration");
n.hasClass("start-animation") || n.hasClass("animation-triggered") || (n.addClass("animation-triggered"), e++, setTimeout(function() {
parseFloat(o) > 0 && (n.css("transition-duration", "0s"), t(o)),
n.addClass("start-animation"),
n.hasClass("skills") && n.animateSkills()
},
200 * e))
})
}
$.fn.animateSkills = function() {
$(".skill-value", this).each(function() {
var e = $(this),
t = e.data("width");
e.css({
width: t + "%"
})
})
},
e(),
$(window).on("scroll",
function() {
e()
})
}
};
</script> 展开
var animElements = {
init: function() {
function e() {
var e = -1;
$(".anim_emt:not(.start-animation):in-viewport").each(function() {
function t(e) {
setTimeout(function() {
n.css({
"transition-duration": e,
"-webkit-transition-duration": e
})
},
200)
}
var n = $(this),
o = n.css("transition-duration");
n.hasClass("start-animation") || n.hasClass("animation-triggered") || (n.addClass("animation-triggered"), e++, setTimeout(function() {
parseFloat(o) > 0 && (n.css("transition-duration", "0s"), t(o)),
n.addClass("start-animation"),
n.hasClass("skills") && n.animateSkills()
},
200 * e))
})
}
$.fn.animateSkills = function() {
$(".skill-value", this).each(function() {
var e = $(this),
t = e.data("width");
e.css({
width: t + "%"
})
})
},
e(),
$(window).on("scroll",
function() {
e()
})
}
};
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询