This is a pretty basic question. I have this block of code which I thought was OK but its throwing up an error...
Uncaught TypeError: undefined is not a function
Here is the code in question
$('.colourbox').each(function(i){
// select visible children
var visibleDivs = $(this).children('div').length;
// use whatever width calculation you'd like...
var targetWidth = 300 / visibleDivs.length - 1;
// apply the width to the divs
visibleDivs.width(targetWidth);
});
Thanks