Use this:
imageWidth = $(this).children("img").attr("width")
The following selects all your images:
$(".thumb img")
... so when you ask for the attribute it returns it from the first object in the collection
Sorry for all the edits... but it is best to reuse jquery objects, so:
var $this = $(this)
Then refer to $this were needed for optimization. Not that big a deal in this example, but it is a good practice to use.
happytime harry
2009-08-13 18:50:49