$("#trigger-1").click(function () {
$("#secondary").animate({ width: 0 });
$("#primary").animate({ width: '100%' });
$("#panel-1").css({ display: "block" }).animate({
height: 200,
width: '100%',
opacity: 1
});
return false;
});
$("#trigger-2").click(function () {
$("#secondary").animate({ width: 0 });
$("#primary").animate({ width: '100%' });
$("#panel-2").css({ display: "block" }).animate({
height: 200,
width: '100%',
opacity: 1
});
return false;
});
$("#return").click(function () {
alert(1);
$("#primary").animate({ width: '60%' });
$("#secondary").animate({ width: '40%' });
$(".panel").animate({
height: 0,
width: 0,
opacity: 0
});
return false;
});
Return is not working for panel-2. Please check this fiddle: http://jsfiddle.net/HTVXv/
Also, please guide me if its possible to refactor and reduce the code.
Thanks!