code: function isFailX(elFuturePos, elRegion, visibleRect) {
    return elFuturePos.left < visibleRect.left ||
      elFuturePos.left + elRegion.width > visibleRect.right;
  }
docs: http://yiminghe.iteye.com/blog/1124720