$(".button-wrap.enter-now").click(isMobile ?
function(){
window.location = 'form/form.html';
}
: function(){
TweenMax.to($iframeBg, 0.35, {startAt:{top:0}, opacity:1 });
TweenMax.to($("#form-wrapper"), 0.45, {top:"8%", delay:0.05, ease:Power3.easeOut, opacity:1});
});
$("#close-form").click(function(){
TweenMax.to($("#form-wrapper"), 0.45, {opacity:0, top:"110%", ease:Power3.easeOut});
TweenMax.to($iframeBg, 0.25, {opacity:0, delay:0.1});
TweenMax.to($iframeBg, 0.01, {top:"120%", delay:0.45});
});
我有非 ie8 的上述代码,以及 ie8 下面的代码——它们看起来完全一样,只是补间中没有不透明度:
if(ie8){
$(".button-wrap.enter-now").click(isMobile ?
function(){
window.location = 'form/form.html';
}
: function(){
TweenMax.to($iframeBg, 0.35, {startAt:{top:0} });
TweenMax.to($("#form-wrapper"), 0.45, { top:"8%", delay:0.05, ease:Power3.easeOut});
});
$("#close-form").click(function(){
TweenMax.to($("#form-wrapper"), 0.45, {top:"110%", ease:Power3.easeOut});
TweenMax.to($iframeBg, 0.25, { delay:0.1});
TweenMax.to($iframeBg, 0.01, {top:"120%", delay:0.25});
});
}
我只是想知道,如何将代码简化为一个?我什至不知道要搜索什么。非常感谢。