dynamically positioning question

dynamically positioning question


In css I have this defined:

#button {
   position:absolute;
   right:0px;
   top:0px;
   z-index:2;
   width:70px;
   height:70px;
   background-image:url(button.png);
   background-repeat:no-repeat;
}

In the jQuery I have this:

$("#button").css( {
        /*
        top: "60px",
        left: "60px"
        */
        left: xs[0].toString(),
        top: ys[0].toString()
    }
);

If I reposition #button with the commented-out 60px lines it works fine. However, I'd like to position it to some calculated globals ( xs[] and ys[] ). The above code doesn't work. The xs[] and ys[] arrays have been pre calculated at the beginning of $(document).ready().

Is it possible to do something like this? If so, what do I need to change to get it to work?

thanks,
Bob