views:

737

answers:

1

http://i44.tinypic.com/b69h1h.jpg

Take a look at the above image, especially the Firebug window.

Now have a look here:

http://i40.tinypic.com/v2z4up.jpg

Has anyone noticed that my JS isn't working? This code was working when I wrote it and let it sit individually, but now that I've integrated it into a site, it appears that the vote box does not change the location as desired.

+4  A: 

The CSS measures are always expressed with a unit : you need to add "px" to the left and top CSS attributes.

element.setStyle({left: 2+'px', top: 2+'px'});

I think you need to show the elements, as setting a position to a hidden element is not really useful.

element.show().setStyle({left: 2+'px', top: 2+'px'});
Fabien Ménager
Ah, perfect, can't believe I overlooked that. Though I wonder why it worked before...
a2h