improve for resize window + support for left, right, top, bottom

required  jQuery and underscore .js