$(document).ready(function(){
//slideshow transition type - all transition types included with jquery cycle will work
var transition = 'fade';
//turn the pan's negative if you'd like to transition the other way
var pan_x = -30;
var pan_y = -150;
//# of seconds between fades
var fadeDisplayTime = 7
//# of seconds it takes to pan on the x/y axis
var pan_x_time = 7
var pan_y_time = 7
$("#menu a").blend();
//-------------- begin cycle plugin with panning effect
$.fn.getXdir = function (){
return ( $(this).hasClass("panLeft") ) ? 1 : -1;
}
$.fn.getYdir = function (){
return ( $(this).hasClass("panDown") ) ? 1 : -1;
}
$.fn.initSlidePos = function ( x, y ){
//Set x
if( $(this).getXdir() < 0 ) {
$(this).css({ left: 0 });
} else {
$(this).css({ left: (x * $(this).getXdir() ) });
}
//Set y
if( $(this).getYdir() < 0 ) {
$(this).css({ top: 0 });
}else{
$(this).css({ top: ( y * $(this).getYdir() ) });
}
return $(this);
}
var firstTime = true;
$('#slides').cycle({
fx: transition,
timeout: (fadeDisplayTime * 1000),
before: function(currSlideElement, nextSlideElement, options, forwardFlag){
var $obj = $(this);
if(firstTime){
$obj.initSlidePos( pan_x, pan_y);
firstTime = false;
}
setTimeout( function(){
$obj.initSlidePos( pan_x, pan_y );
}, 50);
},
after: function(currSlideElement, nextSlideElement, options, forwardFlag){
var $obj = $(this);
if( $obj.getXdir() < 0 ) {
$obj.animate({ left: pan_x },{ duration: (1000 * pan_x_time), queue:true });
} else {
$obj.animate({ left: "0" },{ duration:(1000 * pan_x_time), queue:false })
}
if( $obj.getYdir() < 0 ) {
$obj.animate({ top: ( pan_y )},{ duration:(1000 * pan_y_time), queue:false })
} else {
$obj.animate({ top: "0" },{ duration:(1000 * pan_y_time), queue:false })
}
}
});
//-------------- end cycle plugin with panning effect
});