Box2D physics engine works according to the rules of physics. You have to work a little bit to set it up to work with platforms like HTML5 Canvas, iOS or Flash. Read the details

Box2d coordinate system for HTML5 Canvas