Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sleep(millis){var njf1=njen(this,arguments,"millis");nj:while(1){switch(njf1.cp){case 0:
- njf1._notifier=new EventNotifier();
- setTimeout(njf1._notifier,njf1._millis);njf1.pc(1,
- njf1._notifier,"wait",[]);case 1:with(njf1)if((rv1=f.apply(c,a))==NJSUS){return fh;}break nj;}}}
- function animate(element,property,endValue,duration,frequency){var njf1=njen(this,arguments,"element","property","endValue","duration","frequency");nj:while(1){switch(njf1.cp){case 0:
- njf1._frameCount=Math.ceil(njf1._duration/njf1._frequency);
- njf1._startValue=parseInt(njf1._element.style[njf1._property],10);
- njf1._distance=njf1._endValue-njf1._startValue;
- njf1._jumpSize=Math.ceil(njf1._distance/njf1._frameCount);
- njf1._i=0;case 2:njf1.cp=(njf1._i<njf1._frameCount-1)?3:4;break;case 3:
- njf1._nextValue=njf1._startValue+(njf1._jumpSize*njf1._i);
- njf1._element.style[njf1._property]=njf1._nextValue+"px";njf1.pc(5,null,
- sleep,[njf1._frequency]);case 5:with(njf1)if((rv5=f.apply(c,a))==NJSUS){return fh;}case 1:njf1._i++;njf1.cp=2;break;case 4:
- njf1._element.style[njf1._property]=njf1._endValue+"px";break nj;}}}
- function waitForClick(element){var njf1=njen(this,arguments,"element");nj:while(1){switch(njf1.cp){case 0:
- njf1._notifier=new EventNotifier();
- njf1._element.onclick=njf1._notifier;njf1.pc(1,
- njf1._notifier,"wait",[]);case 1:with(njf1)if((rv1=f.apply(c,a))==NJSUS){return fh;}break nj;}}}
- function run(){var njf1=njen(this,arguments);nj:while(1){switch(njf1.cp){case 0:
- njf1._theButton=document.getElementById("theButton");case 1:
- njf1.cp=(true)?2:3;break;case 2:
- njf1._theButton.innerHTML="go right";njf1.pc(4,null,
- waitForClick,[njf1._theButton]);case 4:with(njf1)if((rv4=f.apply(c,a))==NJSUS){return fh;}
- njf1._theButton.innerHTML="-->";njf1.pc(5,null,
- animate,[njf1._theButton,"left",200,1000,20]);case 5:with(njf1)if((rv5=f.apply(c,a))==NJSUS){return fh;}
- njf1._theButton.innerHTML="go left";njf1.pc(6,null,
- waitForClick,[njf1._theButton]);case 6:with(njf1)if((rv6=f.apply(c,a))==NJSUS){return fh;}
- njf1._theButton.innerHTML="<--";njf1.pc(7,null,
- animate,[njf1._theButton,"left",0,1000,20]);case 7:with(njf1)if((rv7=f.apply(c,a))==NJSUS){return fh;}njf1.cp=1;break;case 3:break nj;}}}
- spawn(run());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement