Skip to content

Instantly share code, notes, and snippets.

@codeyu
Forked from npow/dnd.js
Created February 25, 2016 07:14
Show Gist options
  • Save codeyu/de25e7e66cb22631e249 to your computer and use it in GitHub Desktop.
Save codeyu/de25e7e66cb22631e249 to your computer and use it in GitHub Desktop.
PhantomJS drag and drop
var page = require('webpage').create();
page.open('http://jsbin.com/ifuma#noedit', function () {
setTimeout(function () {
page.sendEvent("mousedown", 10, 10);
page.sendEvent("mousemove", 200, 200);
page.sendEvent("mouseup", 200, 200);
page.render('ss.png');
phantom.exit();
}, 3000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment