I have an element I am changing with an animation as follows:
that$.animate({
opacity:'0.0'
},300,
function() {
$('#menuHolder').css({
left:'0px',
top:'0px',
height:'100%',
width:'100%',
},0);
This is meant to make menuHolder take up the whole screen. When clicking a separate button, I want menuHolder to revert to the original values i assigned in the style sheet. Here is the code for the return button:
$('.return').bind('click',
function() {
$(this).hide(300);
tMT$ = $(this).parent();
tMT$.animate({
opacity:'0.0'
},300,
function() {
$('#menuHolder').css({
left:$(this).style.left,
top:$(this).style.top,
height:$(this).style.height,
width:$(this).style.width
},0);
})
This doesnt work, because I have assigned the original css values with when that$.animate was executed. How should I assign the values of .return's click so that menuHolder reverts to its original css?
I don't want to manually reassign values. I would rather do it programmatically =D. Any help would be great.
Cheers.