Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 11th, 2012  |  syntax: None  |  size: 0.28 KB  |  views: 325  |  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. Zoom a layer at the point of click with kineticjs
  2. image_part.on('click', function(evt){
  3.     zoom += 0.1;
  4.     var offset = layer.getOffset();
  5.     layer.setOffset(evt.pageX, evt.pageY);
  6.     layer.setScale(zoom);
  7.     layer.setX(evt.pageX);
  8.     layer.setY(evt.pageY);
  9.     layer.draw();
  10. });