Skip to content

Instantly share code, notes, and snippets.

@luishdez
Created December 11, 2010 06:06
Show Gist options
  • Save luishdez/737191 to your computer and use it in GitHub Desktop.
Save luishdez/737191 to your computer and use it in GitHub Desktop.
mobi_fx = {
show: function(o){o.style.display = 'block'},
hide: function(o){o.style.display = 'none'},
fadeIn: function(l){if(!l) l=1;mobi_fx.setOpacity(0); mobi_fx.show(mobi_modal.overlay); for(i=0;i<=1;i+=(1/50)){setTimeout("mobi_fx.setOpacity("+i*l+")",i*700);} setTimeout("mobi_fx.setOpacity("+l+")", 700); setTimeout("mobi_fx.show(mobi_modal.overlay)", 700);},
fadeOut: function(l){if(!l) l=1;for(i=0;i<=l;i+=(1/50)){setTimeout("mobi_fx.setOpacity("+(l-i)+")",i*700);}setTimeout("mobi_fx.hide(mobi_modal.overlay)", 700);},
ease: function(t,b,c,d){var s=1.30158; if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) +b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;},
animateTop: function(s,e){for(i=0;i<=1;i+=(1/60)){setTimeout("mobi_fx.setTop("+mobi_fx.ease(i,s,e,1)+")",i*1300);}},
animateHeight: function(s,e){for(i=0;i<=1;i+=(1/60)){setTimeout("mobi_fx.setHeight("+mobi_fx.ease(i, s, e-s,1)+")", i*500);}setTimeout("mobi_fx.setHeight("+e+")", i*500);},
setTop: function(x){mobi_modal.elLayer.style.top = Math.round(x) + 'px'},
setHeight: function(x){x = Math.round(x); mobi_modal.elBox1.style.height=(x+20)+'px'; mobi_modal.elBox2.style.height=(x)+'px';mobi_modal.elIframe.style.height=(x)+'px';},
setOpacity: function(x){var o = mobi_modal.overlay; o.style.opacity=x;o.style.MozOpacity=x;o.style.KhtmlOpacity=x;o.style.filter="alpha(opacity=" + (x * 100) + ");"}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment