Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript JQuery Css width of a div returns undefined. Re: JQuery Css width of a div returns undefined.

#107651
Noel Forte
Participant

fixed it. apparently this is the wrong way to do it:





Demo








and this is the RIGHT way:





Demo








if you do do it the first way, by loading the scripts in the head, you need to call

$(document).ready(function(){
//Code goes here.
});

in your script file.