store $('.container') before the loop instead of querying each time