javascript, jQuery: how to save values instead of the references
- by Patrick
hi,
I'm using the following lines to store the location of an object.
var lightboxTop = $('#lightbox').css('top');
var lightboxLeft = $('#lightbox').css('
left');
I'm successively moving this object in my element, and I want to restore it previous position with the stored variables.
But, I'm afraid javascript is saving the values by reference so I lose the initial positions. Am I correct ? How can I solve this ?
thanks