(function($){ var container=$(".container"); var box=$(".box"); var buddy=$(".buddy"); var pop=$(".pop"); var open=$(".btn"); var close=$(".close"); var imgs=pop.find('img'); $.Velocity.RegisterUI('liyue.slideUpIn',{ defaultDuration:500, calls:[ [{opacity:[1,0],translateY:[0,100]}] ] }); $.Velocity.RegisterUI('liyue.slideDownOut',{ defaultDuration:300, calls:[ [{opacity:[0,1],translateY:[100,0]}] ] }); $.Velocity.RegisterUI('liyue.scaleIn',{ defaultDuration:300, calls:[ [{opacity:[1,0],scale:[1,0.3]}] ] }); $.Velocity.RegisterUI('liyue.scaleOut',{ defaultDuration:300, calls:[ [{opacity:[0,1],scale:[0.3,1]}] ] }); var seqInit=[{ elements:container, properties:'liyue.slideUpIn', options:{ delay:300 } },{ elements:box, properties:'liyue.slideUpIn', options:{ sequenceQueue:false } },{ elements:buddy, properties:'liyue.slideUpIn', options:{ sequenceQueue:false, delay:60 } }]; var seqClick=[{ elements:container, properties:'liyue.slideDownOut', },{ elements:box, properties:'liyue.slideDownOut', options:{ sequenceQueue:false } },{ elements:container, properties:'liyue.slideUpIn', },{ elements:pop, properties:'liyue.slideUpIn', options:{ sequenceQueue:false } },{ elements:img, properties:'liyue.scaleIn', }]; var seqClose=[,{ elements:img, properties:'liyue.scaleOut', },{ elements:container, properties:'liyue.slideDownOut', },{ elements:pop, properties:'liyue.slideDownOut', options:{ sequenceQueue:false } },{ elements:container, properties:'liyue.slideUpIn', },{ elements:box, properties:'liyue.slideUpIn', options:{ sequenceQueue:false } }]; $.Velocity.RunSequence(seqInit); open.on('click',function(){ $.Velocity.RunSequence(seqClick); }); close.on('click',function(){ $.Velocity.RunSequence(seqClose); });})(jQuery);
添加回答
举报
0/150
提交
取消