1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
// run the currently selected effect
function runEffect(what,folder) {
// get effect type from
var selectedEffect = "slide";
/*
Different effets:
blind, bounce, clip, drop, explode, fold, highlight, puff, pulsate, scale, shake, size, slide
*/
// most effect types need no options passed by default
var options = {};
// some effects have required parameters
if ( selectedEffect === "scale" ) {
options = { percent: 100 };
} else if ( selectedEffect === "size" ) {
options = { to: { width: 600, height: 400 } };
} else if ( selectedEffect === "blind"){
options = { direction: "horizontal" };
} else if ( selectedEffect === "slide"){
options = { direction: "up" };
}
loadingImages(folder,what);//folder, destination (#lemas)
// run the effect
// $( "#"+what ).show( selectedEffect, options, 500, callback );
// run the effect
if($("#"+what).is(":visible")){
//$( "#"+what ).fadeOut();
$( "#"+what ).hide( selectedEffect, options, 1000, callback(what) );
//alert('hide');
}else{
//alert('show');
//$( "#"+what ).fadeIn();
$( "#"+what ).show( selectedEffect, options, 1000, callback(what) );
}
}; |
Partager