resizing logic which works on all browsers

all rolled up on master
still need to solve flicker issue on ie11
some of the samples don't have a style line, these need to be made consistent w/ the others