I have the following function:
$("#myId").css({left: leftVal+"px", top:topVal+"px"});
this works.
I am looking for a way to add left: leftVal+"px", top:topVal+"px"
as a variable and make my function:
$("#myId").css({myCSSstuff});
I've tryed
var myCSSstuff= "left: "+leftVal+"px, top:"+topVal+"px"
but it does not work. Is there a way to do this? Thanx.