tags:

views:

79

answers:

0

I've got a simple snippet I use to animate polls. I'm using the snippet in Drupal, but drupal uses an inline percent width and the script goes all wacky. It animates way past the maximum length of the poll bars. I have tried the same code with pixel widths and it works fine.

Any ideas? Here's the code.

$(".poll .bar .foreground").width().animate({ width: "show" }, 5000 );

I should also add that I've tried this.

alert($(".poll .bar .foreground").width());

If also gives me the wrong width in pixels.