$(function() {
var tempo = 'slow'; // 'slow' 'fast' 'normal' 600 (number)
var opacitySlideImg = 0.5; // opacity Slide Image
var opacitySlideTxt = 0.5; // opacity Slide Text
var opacityTxt = 0.9; // opacity Text over
var width = ('', $('.slideImg').outerWidth(true));
var height = ('', $('.slideImg').outerHeight(true));
var units = 'px';
var minusHeight = -height;
var minusWidth = -width;
var plusHeight = +height;
var plusWidth = +width;
$('.slideImgTxt').css({'width':width+units,'height':height+units});
$('.slideImg').css({'width':width+units,'height':height+units});
$('.slideTxt').css({'width':width+units,'height':height+units,'opacity':opacitySlideTxt});
// site slide
$('.slideTxt-top').css({'top':minusHeight+units});
$('.slideTxt-right').css({'left':plusWidth+units});
$('.slideTxt-bottom').css({'top':plusHeight+units});
$('.slideTxt-left').css({'left':minusWidth+units});
// corner slide
$('.slideTxt-top-right').css({'top':minusHeight+units,'left':plusWidth+units});
$('.slideTxt-right-bottom').css({'top':plusHeight+units,'left':plusWidth+units});
$('.slideTxt-bottom-left').css({'top':plusHeight+units,'left':minusWidth+units});
$('.slideTxt-left-top').css({'top':minusHeight+units,'left':minusWidth+units});
$('.slideImgTxt').hover(function() {
$(this).children('.slideImg').stop().animate({
right: 0,
bottom: 0,
opacity: opacitySlideImg
},tempo);
$(this).children('.slideTxt').stop().animate({
top: 0,
left: 0,
opacity: opacityTxt
},tempo);
},function() {
// top down
$(this).children('.slideTxt-top').stop().animate({
top: minusHeight,
opacity: opacitySlideTxt
},tempo);
// right to left
$(this).children('.slideTxt-right').stop().animate({
left: plusWidth,
opacity: opacitySlideTxt
},tempo);
// bottom up
$(this).children('.slideTxt-bottom').stop().animate({
top: plusHeight,
opacity: opacitySlideTxt
},tempo);
// left to right
$(this).children('.slideTxt-left').stop().animate({
left: minusWidth,
opacity: opacitySlideTxt
},tempo);
// top-right corner
$(this).children('.slideTxt-top-right').stop().animate({
top: minusHeight,
left: plusWidth,
opacity: opacitySlideTxt
},tempo);
// right-bottom corner
$(this).children('.slideTxt-right-bottom').stop().animate({
left: plusWidth,
top: plusHeight,
opacity: opacitySlideTxt
},tempo);
// bottom-left corner
$(this).children('.slideTxt-bottom-left').stop().animate({
top: plusHeight,
left: minusWidth,
opacity: opacitySlideTxt
},tempo);
// left-top corner
$(this).children('.slideTxt-left-top').stop().animate({
top: minusHeight,
left: minusWidth,
opacity: opacitySlideTxt
},tempo);
$(this).children('.slideImg').stop().animate({
top: 0,
left: 0,
opacity: 1
},tempo);
});
});