jQuery影藏顯示滑動效果
影藏顯示區塊套用jQuery來做動做
是最輕鬆漂亮的
滑鼠滑入顯示滑動效果
區塊中依然可以是文字、圖片或連結
滑入後才會漸進展開資訊
節約版面
search/searchrsearch-
Best Test a Antee hsearcht
Antee v Szh r-1i
i
-1 About ssearcharsearchhAsearchAsearchosearcht-1tsearchA Contact te Contact searchse-1r Math h$-1M Bestmathtest th Szh e Test B
s Best m Test tsearcht Antee stsearchrsearche-1rc Bestmathtest h-1 Math e Test tmt Szh t Contact st Contact .-1ysearchlsearch.-1r Best n Test i About i Bestmathtest nsearch[
x Math ;
if ($.isFunction(init))
init(opts.$cont, $(opts.elements), opts);
};
// this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt
function go(els, opts, manual, fwd) {}
// don’t begin another timeout-based transition if there is one active
if (opts.busy) {}
var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide];
// stop cycling if we have an outstanding stop request
if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual)
return;
// check to see if we should stop cycling based on autostop options
if (!manual && !p.cyclePause && !opts.bounce &&
((opts.autostop && (–opts.countdown <= 0)) ||
(opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {}
// if slideshow is paused, only transition on a manual trigger
var changed = false;
if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) {}
// one-time fx overrides apply to: $(‘div’).cycle(3,’zoom’);
if (opts.oneTimeFx) {}
$.fn.cycle.resetState(opts, fx);
// run the before callbacks
if (opts.before.length)
$.each(opts.before, function(i,o) {});
// stage the after callacks
var after = function() {});
if (!p.cycleStop) {}
};
debug(‘tx firing(‘+fx+’); currSlide: ‘ + opts.currSlide + ‘; nextSlide: ‘ + opts.nextSlide);
// get ready to perform the transition
opts.busy = 1;
if (opts.fxFn) // fx function provided?
opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ?
$.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent);
else
$.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent);
}
else {}
if (changed || opts.nextSlide == opts.currSlide) {});
}
opts.nextSlide = opts.randomMap[opts.randomIndex];
if (opts.nextSlide == opts.currSlide)
opts.nextSlide = (opts.currSlide == opts.slideCount – 1) ? 0 : opts.currSlide + 1;
}
else if (opts.backwards) {}
else {}
}
else {}
else {}
}
}
if (changed && opts.pager)
opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass);
function queueNext() {}
else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic
ms = 10;
if (ms > 0)
p.cycleTimeout = setTimeout(function(){}, ms);
}
};
// invoked after transition
$.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) {});
};
// calculate timeout value for current transition
function getTimeout(curr, next, opts, fwd) {}
return opts.timeout;
};
// expose next/prev function, caller must pass in state
$.fn.cycle.next = function(opts) {};
$.fn.cycle.prev = function(opts) {};
// advance slide forward or back
function advance(opts, moveForward) {}
if (opts.random && val < 0) {}
else if (opts.random) {}
else {}
else if (opts.nextSlide >= els.length) {}
}
var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated
if ($.isFunction(cb))
cb(val > 0, opts.nextSlide, els[opts.nextSlide]);
go(els, opts, 1, moveForward);
return false;
};
function buildPager(els, opts) {});
opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass);
};
$.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) {}
else
a = ‘‘+(i+1)+’‘;
if (!a)
return;
var $a = $(a);
// don’t reparent if anchor is in the dom
if ($a.parents(‘body’).length === 0) {});
$a = $(arr);
}
else {}
}
opts.pagerAnchors = opts.pagerAnchors || [];
opts.pagerAnchors.push($a);
var pagerFn = function(e) {}
var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated
if ($.isFunction(cb))
cb(opts.nextSlide, els[opts.nextSlide]);
go(els,opts,1,opts.currSlide < i); // trigger the trans
// return false; // <== allow bubble
}
if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) {} );
}
else {}
if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble)
$a.bind(‘click.cycle’, function(){}); // suppress click
var cont = opts.$cont[0];
var pauseFlag = false; // malsup/cycle/issues/44
if (opts.pauseOnPagerHover) {}, function() {}
);
}
};
// helper fn to calculate the number of slides between the current and the next
$.fn.cycle.hopsFromLast = function(opts, fwd) {};
// fix clearType problems in ie6 by setting an explicit bg color
// (otherwise text slides look horrible during a fade transition)
function clearTypeFix($slides) {};
function getBg(e) {}
if (v && v != ‘transparent’)
return v;
}
return ‘#ffffff’;
};
$slides.each(function() {});
};
// reset common props before the next transition
$.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {};
opts.cssAfter.display = ‘none’;
$(curr).css(‘zIndex’,opts.slideCount + (rev === true ? 1 : 0));
$(next).css(‘zIndex’,opts.slideCount + (rev === true ? 0 : 1));
};
// the actual fn for effecting a transition
$.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) {}
var fn = function() {});
};
$l.animate(opts.animOut, speedOut, easeOut, function() {});
if (opts.sync) fn();
};
// transition definitions – only fade is defined here, transition pack defines the rest
$.fn.cycle.transitions = {});
opts.animIn = {};
opts.animOut = {};
opts.cssBefore = {};
}
};
$.fn.cycle.ver = function() {};
// override these globally if you like (they are all optional)
$.fn.cycle.defaults = {}
skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition
slideExpr: null, // expression for selecting slides (if something other than all children is required)
slideResize: 1, // force slide width/height to fixed size before every transition
speed: 1000, // speed of the transition (any valid fx speed value)
speedIn: null, // speed of the ‘in’ transition
speedOut: null, // speed of the ‘out’ transition
startingSlide: undefined, // zero-based index of the first slide to be displayed
sync: 1, // true if in/out transitions should occur simultaneously
timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance)
timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag)
updateActivePagerLink: null, // callback fn invoked to update the active pager link (adds/removes activePagerClass style)
width: null // container width (if the ‘fit’ option is true, the slides will be set to this width as well)
};
})(jQuery);
/*!
* jQuery Cycle Plugin Transition Definitions
* This script is a plugin for the jQuery Cycle Plugin
* Examples and documentation at: jquery/cycle/
* Copyright (c) 2007-2010 M. Alsup
* Version: 2.73
* Dual licensed under the MIT and GPL licenses:
* licenses/mit-license.php
* licenses/gpl.html
*/
(function($) {};
};
// not a cross-fade, fadeout only fades out the top slide
$.fn.cycle.transitions.fadeout = function($cont, $slides, opts) {});
opts.before.push(function(curr,next,opts,w,h,rev) {});
opts.animIn.opacity = 1;
opts.animOut.opacity = 0;
opts.cssBefore.opacity = 1;
opts.cssBefore.display = ‘block’;
opts.cssAfter.zIndex = 0;
};
// scrollUp/Down/Left/Right
$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {};
$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {};
$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {};
$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {};
$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {});
opts.cssFirst.left = 0;
opts.cssBefore.top = 0;
opts.animIn.left = 0;
opts.animOut.top = 0;
};
$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {});
opts.cssFirst.top = 0;
opts.cssBefore.left = 0;
opts.animIn.top = 0;
opts.animOut.left = 0;
};
// slideX/slideY
$.fn.cycle.transitions.slideX = function($cont, $slides, opts) {});
opts.cssBefore.left = 0;
opts.cssBefore.top = 0;
opts.cssBefore.width = 0;
opts.animIn.width = ‘show’;
opts.animOut.width = 0;
};
$.fn.cycle.transitions.slideY = function($cont, $slides, opts) {});
opts.cssBefore.left = 0;
opts.cssBefore.top = 0;
opts.cssBefore.height = 0;
opts.animIn.height = ‘show’;
opts.animOut.height = 0;
};
// shuffle
$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {});
opts.before.push(function(curr,next,opts) {});
// only adjust speed once!
if (!opts.speedAdjusted) {}
opts.random = 0;
opts.shuffle = opts.shuffle || {};
opts.els = [];
for (i=0; i < $slides.length; i++)
opts.els.push($slides[i]);
for (i=0; i < opts.currSlide; i++)
opts.els.push(opts.els.shift());
// custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
opts.fxFn = function(curr, next, opts, cb, fwd) {}
else {}
$el.animate({}, opts.speedOut, opts.easeOut, function() {});
});
};
$.extend(opts.cssBefore, {});
};
// turnUp/Down/Left/Right
$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {});
opts.cssFirst.top = 0;
opts.cssBefore.left = 0;
opts.cssBefore.height = 0;
opts.animIn.top = 0;
opts.animOut.height = 0;
};
$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {});
opts.cssFirst.top = 0;
opts.cssBefore.left = 0;
opts.cssBefore.top = 0;
opts.cssBefore.height = 0;
opts.animOut.height = 0;
};
$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {});
opts.cssBefore.top = 0;
opts.cssBefore.width = 0;
opts.animIn.left = 0;
opts.animOut.width = 0;
};
$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {});
$.extend(opts.cssBefore, {});
opts.animIn.left = 0;
opts.animOut.width = 0;
};
// zoom
$.fn.cycle.transitions.zoom = function($cont, $slides, opts) {});
$.extend(opts.animOut, {});
});
opts.cssFirst.top = 0;
opts.cssFirst.left = 0;
opts.cssBefore.width = 0;
opts.cssBefore.height = 0;
};
// fadeZoom
$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {});
});
opts.cssBefore.width = 0;
opts.cssBefore.height = 0;
opts.animOut.opacity = 0;
};
// blindX
$.fn.cycle.transitions.blindX = function($cont, $slides, opts) {});
opts.cssBefore.left = w;
opts.cssBefore.top = 0;
opts.animIn.left = 0;
opts.animOut.left = w;
};
// blindY
$.fn.cycle.transitions.blindY = function($cont, $slides, opts) {});
opts.cssBefore.top = h;
opts.cssBefore.left = 0;
opts.animIn.top = 0;
opts.animOut.top = h;
};
// blindZ
$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {});
opts.cssBefore.top = h;
opts.cssBefore.left = w;
opts.animIn.top = 0;
opts.animIn.left = 0;
opts.animOut.top = h;
opts.animOut.left = w;
};
// growX – grow horizontally from centered 0 width
$.fn.cycle.transitions.growX = function($cont, $slides, opts) {});
opts.cssBefore.top = 0;
opts.cssBefore.width = 0;
};
// growY – grow vertically from centered 0 height
$.fn.cycle.transitions.growY = function($cont, $slides, opts) {});
opts.cssBefore.height = 0;
opts.cssBefore.left = 0;
};
// curtainX – squeeze in both edges horizontally
$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {});
opts.cssBefore.top = 0;
opts.cssBefore.width = 0;
};
// curtainY – squeeze in both edges vertically
$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {});
opts.cssBefore.height = 0;
opts.cssBefore.left = 0;
};
// cover – curr slide covered by next slide
$.fn.cycle.transitions.cover = function($cont, $slides, opts) {});
opts.animIn.left = 0;
opts.animIn.top = 0;
opts.cssBefore.top = 0;
opts.cssBefore.left = 0;
};
// uncover – curr slide moves off next slide
$.fn.cycle.transitions.uncover = function($cont, $slides, opts) {});
opts.animIn.left = 0;
opts.animIn.top = 0;
opts.cssBefore.top = 0;
opts.cssBefore.left = 0;
};
// toss – move top slide and fade away
$.fn.cycle.transitions.toss = function($cont, $slides, opts) {});
else
opts.animOut.opacity = 0;
});
opts.cssBefore.left = 0;
opts.cssBefore.top = 0;
opts.animIn.left = 0;
};
// wipe – clip animation
$.fn.cycle.transitions.wipe = function($cont, $slides, opts) {};
var clip;
if (opts.clip) {}
}
opts.cssBefore.clip = opts.cssBefore.clip || clip || ‘rect(0px 0px 0px 0px)’;
var d = opts.cssBefore.clip.match(/(\d+)/g);
var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10);
opts.before.push(function(curr, next, opts) {});
(step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
})();
});
$.extend(opts.cssBefore, {});
opts.animIn = {};
opts.animOut = {};
};
})(jQuery);