zepto下加载openbox弹出层
function fnOpenBox(objId,animateD,speed,tween,hide){ var oOpenBox = $(objId); oOpenBox.show(); oOpenBox.animate(animateD,speed,tween,function(){ if(hide){ oOpenBox.hide(); } }); }
调用
//btn click var oBtn = document.getElementById("btn1"); oBtn.onclick = function(){ fnOpenBox("#openbox1",{opacity:1,bottom:"0px"},300,"ease-out"); } //close click var oBtn = document.getElementById("close1"); oBtn.onclick = function(){ fnOpenBox("#openbox1",{opacity:0,bottom:"-100%"},300,"ease-out",true); }