Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 25th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to move and destroy image in dojo?
  2. var targetNode = dojo.byId('roulette');
  3. var image = 'http://dojotoolkit.org/images/logo.png';
  4. dojo.place("<img src='" + image + "' />", targetNode);
  5.  
  6. // Get dynamically created node
  7. var node = dojo.query('#' + targetNode.id + ' img:last')[0];
  8.  
  9. var animation = dojo.fx.slideTo({
  10.   node: node,
  11.   top: (dojo.coords(node).t).toString(),
  12.   left: (dojo.coords(node).l - 1).toString(),
  13.   unit: 'px'
  14. });
  15.  
  16.  
  17. dojo.connect(animation, 'onAnimate', function() {
  18.   // How to repeat?
  19. }
  20.  
  21. animation.play();
  22.        
  23. <div id="roulette" style="width: 60em; height: 5em; overflow: hidden;"></div>