SOURCE CODE: Marquee With Rest Update

VIEW EXAMPLE




  Marquee With Rest Update | JavaScript Examples | UIZE JavaScript Framework
  
  
  
  
  
  






UIZE JavaScript Framework

JAVASCRIPT EXAMPLES Marquee With Rest Update

In this example, an instance of Uize.Widget.Resizer.Marquee has been created to allow you to move and resize a marquee. The region that is occupied by the marquee is highlighted. Updating this highlight is actually phenomenally quick, but imagine - if you will - that the highlight is a proxy for some very computationally heavy task that needs to be informed by the marquee's position. You might not want such a computationally heavy task to be performed on every single move of the marquee during the drag process. The Uize.Widget.Resizer.Marquee class provides a convenient 'Drag Rest' instance event, whose rest time is configurable through the dragRestTime instance state property. Drag the marquee around and notice that the highlight doesn't update unless you rest during the drag process for 250 milliseconds, or you end drag. If you drag without resting and then release, the 'Drag Rest' event is always fired immediately upon release.