jQuery window resize

Posted by Happy on Stack Overflow See other posts from Stack Overflow or by Happy
Published on 2010-05-13T08:51:42Z Indexed on 2010/05/13 10:24 UTC
Read the original article Hit count: 327

Filed under:
|

I have piece of javascript code, which should process when the browser window is resized.

resize.style.marginRight=(resize.offsetWidth-$(this)[0].offsetWidth)+'px'

Tryed this stuff (doesn't work):

window.onresize = function(event) {
resize.style.marginRight=(resize.offsetWidth-$(this)[0].offsetWidth)+'px'
}

Full code available - http://jsbin.com/adelu3/2/ (see page source)

Thanks.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about resize