.css() & the "top"/"left" attribute
Hello Folks,
I build a website with a draggable div on it.
The position (x and y) of the div is written into two input fields.
Now i wanted to do, that the browser remembers the position, when the site has got refreshed.
So I wrote something like that:
-
function place_box() {
//input fields
var posy = $('#pos_y').attr("value");
var posx = $('#pos_x').attr("value");
$('.box').css({
top: posy,
left: posx
});
}
But this doesn't work! Also .css("top", posy) doesn't work.
All other attributes are working with variables and without variables.. like "color: #000" or "color: varcolor" etc.
What can I do? I am a newbie in jQuery!
