im no expert javascript coder.
i used like 5 hours now trying alot of different stuff. and i noticed some things that i cant figure out
im trying to get this to work
width = $('#immagineCont').attr('clientWidth');
but it returns undefined
i tried doing
width = $('#immagineCont').attr('id');
witch returned #immagineCont i guess is correct.
when i use
$('#immagineCont')
i get this in firebug 1)
http://bildr.no/view/1325119 2)
http://bildr.no/view/1325120
so what im trying to do is get the damn clientWidth witch seems impossible. i even tryed children(“0”) and children(“#0”)
im going blow my brains soon ^^
attrwould only work if there was an attribute with this name.You may simply use
but you more probably need
which is more reliable when you want to do something that works the same across browsers (but doesn’t include padding and borders).
You might also be interested by outerWidth.
A note about what happens and the need for
get(0): a jQuery collection (like$('#immagineCont')) wraps one or more standard DOM objects that you can get usingget(i)or[i]. If you want to access native properties of the DOM object, when jQuery doesn’t offer a proxy function, you need to get this native object first.