I had this code (with the first general function animateImage(e) I wished to substitute the following four and implement them on my html like below of it:
function animateImage(e)
{
var ww = $(window).width();
var newiw = (ww/100)*e.data.percent;
$("#imageIn") .stop().animate({'width': e.data.imageExtend+'%'}, e.data.duration, 'ease'+e.data.ease+'Back');
$("#shadow") .stop().animate({'left': e.data.imageExtend+'%'}, e.data.duration, 'ease'+e.data.ease+'Back');
if (newiw < 2000)
{
$("#character_lab") .stop().animate({'margin-left': e.data.charLeft+'%','width': newiw + 'px','height': (newiw/4) + 'px', 'margin-top': -(newiw/8) + 'px'}, e.data.duration, 'ease'+e.data.ease+'Back');
}
else
{
$("#character_lab") .stop().animate({'margin-left': e.data.charLeft+'%','width': newiw + 'px','height': '500px', 'margin-top': '-250px'}, e.data.duration, 'ease'+e.data.ease+'Back');
}
$("#letters_2") .stop().animate({'margin-left': e.data.lettersLeft+'%'}, e.data.duration, 'ease'+e.data.ease+'Back');
$("#name") .stop().animate({'margin-left': e.data.nameLeft+'%'}, e.data.duration, 'ease'+e.data.ease+'Back');
};
/* Trial end*/
function suggestImage()
{
var ww = $(window).width();
var newiw = (ww/100)*94;
$("#imageIn") .stop().animate({'width': '6%'}, 950, 'easeOutBack');
$("#shadow") .stop().animate({'left': '6%'}, 950, 'easeOutBack');
if (newiw < 2000)
{
$("#character_lab") .stop().animate({'margin-left': '4%','width': newiw + 'px','height': (newiw/4) + 'px', 'margin-top': -(newiw/8) + 'px'}, 950, 'easeOutBack');
}
else
{
$("#character_lab") .stop().animate({'margin-left': '4%','width': newiw + 'px','height': '500px', 'margin-top': '-250px'}, 950, 'easeOutBack');
}
$("#letters_2") .stop().animate({'margin-left': '2%'}, 950, 'easeOutBack');
$("#name") .stop().animate({'margin-left': '3%'}, 950, 'easeOutBack');
};
function letImage()
{
var ww = $(window).width();
var newiw = (ww/100)*100;
$("#imageIn") .stop().animate({'width': '0%'}, 950, 'easeInBack');
$("#shadow") .stop().animate({'left': '0%'}, 950, 'easeInBack');
if (newiw < 2000)
{
$("#character_lab") .stop().animate({'margin-left': '0%','width': newiw + 'px','height': (newiw/4) + 'px', 'margin-top': -(newiw/8) + 'px'}, 950, 'easeInBack');
}
else
{
$("#character_lab") .stop().animate({'margin-left': '0%','width': newiw + 'px','height': '500px', 'margin-top': '-250px'}, 950, 'easeInBack');
}
$("#letters_2") .stop().animate({'margin-left': '0%'}, 950, 'easeInBack');
$("#name") .stop().animate({'margin-left': '0%'}, 950, 'easeInBack');
};
function fullImage()
{
var ww = $(window).width();
var newiw = (ww/100)*76;
$("#imageIn") .animate({'width': '24%'}, 1900, 'easeOutBack');
$("#shadow") .animate({'left': '24%'}, 1900, 'easeOutBack');
if (newiw < 2000)
{
$("#character_lab") .animate({'margin-left': '22%','width': newiw + 'px','height': (newiw/4) + 'px', 'margin-top': -(newiw/8) + 'px'}, 1900, 'easeOutBack');
}
else
{
$("#character_lab") .animate({'margin-left': '22%','width': newiw + 'px','height': '500px', 'margin-top': '-250px'}, 1900, 'easeOutBack');
}
$("#letters_2") .animate({'margin-left': '24%',}, 1900, 'easeOutBack');
$("#name") .animate({'margin-left': '21%'}, 1900, 'easeOutBack');
$("#text") .animate({'margin-left': '36%', 'margin-right': '19%'}, 1900, 'easeOutBack');
imageout = 1;
}
function removeImage()
{
var ww = $(window).width();
var newiw = (ww/100)*100;
$("#imageIn") .animate({'width': '0%'}, 1900, 'easeOutBack');
$("#shadow") .animate({'left': '0%'}, 1900, 'easeOutBack');
if (newiw < 2000)
{
$("#character_lab") .animate({'margin-left': '0%','width': newiw + 'px','height': (newiw/4) + 'px', 'margin-top': -(newiw/8) + 'px'}, 1900, 'easeOutBack');
}
else
{
$("#character_lab") .animate({'margin-left': '0%','width': newiw + 'px','height': '500px', 'margin-top': '-250px'}, 1900, 'easeOutBack');
}
$("#letters_2") .animate({'margin-left': '0%'}, 1900, 'easeOutBack');
$("#name") .animate({'margin-left': '0%'}, 1900, 'easeOutBack');
$("#text") .animate({'margin-left': '19%'}, 1900, 'easeOutBack');
imageout = 0;
}