OLD | NEW |
(Empty) | |
| 1 /*! fancyBox v2.1.2 fancyapps.com | fancyapps.com/fancybox/#license */ |
| 2 (function(B,y,f,q){var p=f(B),m=f(y),b=f.fancybox=function(){b.open.apply(this,a
rguments)},v=null,r=y.createTouch!==q,s=function(a){return a&&a.hasOwnProperty&&
a instanceof f},n=function(a){return a&&"string"===f.type(a)},E=function(a){retu
rn n(a)&&0<a.indexOf("%")},k=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=
b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return k(a,b)+"px"}
;f.extend(b,{version:"2.1.2",defaults:{padding:15,margin:20,width:800,height:600
,minWidth:100,minHeight:100, |
| 3 maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!
0,autoCenter:!r,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling
:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!
0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",hea
ders:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transpa
rent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",3
4:"up",39:"left",40:"up"}, |
| 4 prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]
},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:n
ull,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1">
<div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inne
r"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt
="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" clas
s="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen
mozallowfullscreen allowFullScreen'+ |
| 5 (f.browser.msie?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fa
ncybox-error">The requested content cannot be loaded.<br/>Please try again later
.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="jav
ascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="
javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav f
ancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpee
d:250,openEasing:"swing", |
| 6 openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing
:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:25
0,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,pr
evEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f
.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,befo
reChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:
null,coming:null,current:null, |
| 7 isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,play
er:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers
:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))retur
n f.isArray(a)||(a=s(a)?f(a).get():[a]),f.each(a,function(e,c){var j={},g,h,i,l,
k;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),s(c)?(j={href:c.data("fancybox-hre
f")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,ele
ment:c},f.metadata&&f.extend(!0, |
| 8 j,c.metadata())):j=c);g=d.href||j.href||(n(c)?c:null);h=d.title!==q?d.title:j.ti
tle||"";l=(i=d.content||j.content)?"html":d.type||j.type;!l&&j.isDom&&(l=c.data(
"fancybox-type"),l||(l=(l=c.prop("class").match(/fancybox\.(\w+)/))?l[1]:null));
n(g)&&(l||(b.isImage(g)?l="image":b.isSWF(g)?l="swf":"#"===g.charAt(0)?l="inline
":n(c)&&(l="html",i=c)),"ajax"===l&&(k=g.split(/\s+/,2),g=k.shift(),k=k.shift())
);i||("inline"===l?g?i=f(n(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):j.isDom&&(i=c):"
html"===l?i=g:!l&&(!g&& |
| 9 j.isDom)&&(l="inline",i=c));f.extend(j,{href:g,type:l,content:i,title:h,selector
:k});a[e]=j}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==q&&(b.opts.keys=d.key
s?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},canc
el:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.a
jaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b
.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0).trigger("onReset").remove(),b.
current||b.trigger("afterClose"), |
| 10 b.coming=null)},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.u
nbindEvents(),!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset")
.remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox
-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"
),b.transitions[b.current.closeMethod]()))},play:function(a){var d=function(){cl
earTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.pl
ayer.timer=setTimeout(b.next, |
| 11 b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isA
ctive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.cur
rent&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,f(
"body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.
player":c,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:fu
nction(a){var d=b.current;d&&(n(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"n
ext"))},prev:function(a){var d= |
| 12 b.current;d&&(n(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:f
unction(a,d,e){var c=b.current;c&&(a=k(a),b.direction=d||c.direction[a>=c.index?
"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.le
ngth),a%=c.group.length),c.group[a]!==q&&(b.cancel(),b._start(a)))},reposition:f
unction(a,d){var e=b.current,c=e?e.wrap:null,j;c&&(j=b._getPosition(d),a&&"scrol
l"===a.type?(delete j.position,c.stop(!0,!0).animate(j,200)):(c.css(j),e.pos=f.e
xtend({},e.dim,j)))}, |
| 13 update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeou
t(v),v=null);b.isOpen&&!v&&(v=setTimeout(function(){var c=b.current;c&&!b.isClos
ing&&(b.wrap.removeClass("fancybox-tmp"),"scroll"!==d&&b._setDimension(),"scroll
"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),v=null)},e&&!r?0:300))
},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.c
urrent.fitToView,r&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigg
er("onUpdate")),b.update())}, |
| 14 hideLoading:function(){m.unbind(".loading");f("#fancybox-loading").remove()},sho
wLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div
></div></div>').click(b.cancel).appendTo("body");m.bind("keydown.loading",functi
on(a){27===(a.which||a.keyCode)&&b.cancel()});b.defaults.fixed||(d=b.getViewport
(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:f
unction(){var a=b.current&&b.current.locked||!1,d={x:p.scrollLeft(),y:p.scrollTo
p()};a?(d.w=a[0].clientWidth, |
| 15 d.h=a[0].clientHeight):(d.w=r&&B.innerWidth?B.innerWidth:p.width(),d.h=r&&B.inne
rHeight?B.innerHeight:p.height());return d},unbindEvents:function(){b.wrap&&s(b.
wrap)&&b.wrap.unbind(".fb");m.unbind(".fb");p.unbind(".fb")},bindEvents:function
(){var a=b.current,d;a&&(p.bind("orientationchange.fb"+(r?"":" resize.fb")+(a.au
toCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&m.bind("keydown.fb",f
unction(e){var c=e.which||e.keyCode,j=e.target||e.srcElement;if(27===c&&b.coming
)return!1;!e.ctrlKey&& |
| 16 (!e.altKey&&!e.shiftKey&&!e.metaKey&&(!j||!j.type&&!f(j).is("[contenteditable]")
))&&f.each(d,function(d,j){if(1<a.group.length&&j[c]!==q)return b[d](j[c]),e.pre
ventDefault(),!1;if(-1<f.inArray(c,j))return b[d](),e.preventDefault(),!1})}),f.
fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,j,g){for(v
ar h=f(d.target||null),i=!1;h.length&&!i&&!h.is(".fancybox-skin")&&!h.is(".fancy
box-wrap");)i=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&(h[0
].clientWidth&&h[0].scrollWidth> |
| 17 h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h)
.parent();if(0!==c&&!i&&1<b.group.length&&!a.canShrink){if(0<g||0<j)b.prev(0<g?"
down":"left");else if(0>g||0>j)b.next(0>g?"up":"right");d.preventDefault()}}))},
trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(
e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;"onC
ancel"===a&&!b.isOpened&&(b.isActive=!1);c.helpers&&f.each(c.helpers,function(d,
e){e&&(b.helpers[d]&& |
| 18 f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.hel
pers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return n(a)&&a
.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isS
WF:function(a){return n(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){
var d={},e,c,a=k(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e)
;e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.
type(c)&&(d.padding=[c, |
| 19 c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1
,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.auto
Width=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.
autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoa
d"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b
.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.i
sActive=!0;if("image"=== |
| 20 c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.a
spectRatio=!0);"iframe"===c&&r&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addC
lass("fancybox-"+(r?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.w
rapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),o
uter:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["To
p","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a])
)});b.trigger("onReady"); |
| 21 if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("c
ontent")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===
c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a)
{f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:
0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadIm
age:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this
.onerror=null;b.coming.width= |
| 22 this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this
.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete
&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoa
d=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==
e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.co
ntent=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.ifr
ame.replace(/\{rnd\}/g, |
| 23 (new Date).getTime())).attr("scrolling",r?"auto":a.iframe.scrolling).attr("src",
a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().at
tr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLo
ading(),d.one("load",function(){f(this).data("ready",1);r||f(this).bind("load.fb
",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybo
x-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload|
|b._afterLoad()},_preloadImages:function(){var a= |
| 24 b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1
;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)
},_afterLoad:function(){var a=b.coming,d=b.current,e,c,j,g,h;b.hideLoading();if(
a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("o
nReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop
(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove
());b.unbindEvents(); |
| 25 e=a.content;c=a.type;j=a.scrolling;f.extend(b,{wrap:a.wrap.removeClass("fancybox
-tmp"),skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;s
witch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).f
ind(a.selector):s(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placehol
der",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.sh
ow().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().
replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", |
| 26 !1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='
<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" w
idth="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.eac
h(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'
="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="1
00%" height="100%"'+h+"></embed></object>"}(!s(e)||!e.parent().is(a.inner))&&a.i
nner.append(e);b.trigger("beforeShow"); |
| 27 a.inner.css("overflow","yes"===j?"scroll":"no"===j?"hidden":j);b._setDimension()
;b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.pre
vMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(
!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMeth
od]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=
!1,c=!1,e=b.wrap,j=b.skin,g=b.inner,h=b.current,c=h.width,i=h.height,l=h.minWidt
h,t=h.minHeight,m=h.maxWidth, |
| 28 u=h.maxHeight,r=h.scrolling,p=h.scrollOutside?h.scrollbarWidth:0,x=h.margin,n=k(
x[1]+x[3]),q=k(x[0]+x[2]),y,z,s,C,A,F,B,D,v;e.add(j).add(g).width("auto").height
("auto");x=k(j.outerWidth(!0)-j.width());y=k(j.outerHeight(!0)-j.height());z=n+x
;s=q+y;C=E(c)?(a.w-z)*k(c)/100:c;A=E(i)?(a.h-s)*k(i)/100:i;if("iframe"===h.type)
{if(v=h.content,h.autoHeight&&1===v.data("ready"))try{v[0].contentWindow.documen
t.location&&(g.width(C).height(9999),F=v.contents().find("body"),p&&F.css("overf
low-x","hidden"),A=F.height())}catch(G){}}else if(h.autoWidth|| |
| 29 h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.
height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass(
"fancybox-tmp");c=k(C);i=k(A);D=C/A;l=k(E(l)?k(l,"w")-z:l);m=k(E(m)?k(m,"w")-z:m
);t=k(E(t)?k(t,"h")-s:t);u=k(E(u)?k(u,"h")-s:u);F=m;B=u;h.fitToView&&(m=Math.min
(a.w-z,m),u=Math.min(a.h-s,u));z=a.w-n;q=a.h-q;h.aspectRatio?(c>m&&(c=m,i=k(c/D)
),i>u&&(i=u,c=k(i*D)),c<l&&(c=l,i=k(c/D)),i<t&&(i=t,c=k(i*D))):(c=Math.max(l,Mat
h.min(c,m)),h.autoHeight&& |
| 30 "iframe"!==h.type&&(g.width(c),i=g.height()),i=Math.max(t,Math.min(i,u)));if(h.f
itToView)if(g.width(c).height(i),e.width(c+x),a=e.width(),n=e.height(),h.aspectR
atio)for(;(a>z||n>q)&&(c>l&&i>t)&&!(19<d++);)i=Math.max(t,Math.min(u,i-10)),c=k(
i*D),c<l&&(c=l,i=k(c/D)),c>m&&(c=m,i=k(c/D)),g.width(c).height(i),e.width(c+x),a
=e.width(),n=e.height();else c=Math.max(l,Math.min(c,c-(a-z))),i=Math.max(t,Math
.min(i,i-(n-q)));p&&("auto"===r&&i<A&&c+x+p<z)&&(c+=p);g.width(c).height(i);e.wi
dth(c+x);a=e.width(); |
| 31 n=e.height();e=(a>z||n>q)&&c>l&&i>t;c=h.aspectRatio?c<F&&i<B&&c<C&&i<A:(c<F||i<B
)&&(c<C||i<A);f.extend(h,{dim:{width:w(a),height:w(n)},origWidth:C,origHeight:A,
canShrink:e,canExpand:c,wPadding:x,hPadding:y,wrapSpace:n-j.outerHeight(!0),skin
Space:j.height()-i});!v&&(h.autoHeight&&i>t&&i<u&&!c)&&g.height("auto")},_getPos
ition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+
c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]}
;d.autoCenter&&d.fixed&& |
| 32 !a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w
(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-
f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=
b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.rep
osition(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","p
ointer").bind("click.fb",function(d){if(!f(d.target).is("a")&&!f(d.target).paren
t().is("a"))b[a.closeClick? |
| 33 "close":"next"]()}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.f
b",b.close),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appe
ndTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tp
l.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loo
p&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b
.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(){var a=b.current;f(".fancy
box-wrap").stop(!0).trigger("onReset").remove(); |
| 34 f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOp
en:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterC
lose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.elemen
t,e=a.orig,c={},f=50,g=50,h=a.hPadding,i=a.wPadding,l=b.getViewport();!e&&(a.isD
om&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));s(e)?(c=e.offset(
),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(c.top=l.y+(l.h-g)*a.topRat
io,c.left=l.x+(l.w-f)* |
| 35 a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=l.y,c.left-=l.
x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-i*a.leftRatio),width:w(f+i),
height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpac
e,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.
end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.sk
in[f](k("width"===f?c:c-g*e)),b.inner[f](k("width"===f?c:c-g*e-h*e))},zoomIn:fun
ction(){var a=b.current, |
| 36 d=a.pos,e=a.openEffect,c="elastic"===e,j=f.extend({opacity:1},d);delete j.positi
on;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.op
acity=0.1);b.wrap.css(d).animate(j,{duration:"none"===e?0:a.openSpeed,easing:a.o
penEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){va
r a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrig
Position(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,{duration:"none"===
d?0:a.closeSpeed,easing:a.closeEasing, |
| 37 step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.cu
rrent,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elasti
c"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(k(e
[g])-200),c[g]="+=200px"):(e[g]=w(k(e[g])+200),c[g]="-=200px"));"none"===d?b._af
terZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,co
mplete:function(){setTimeout(b._afterZoomIn,20)}})},changeOut:function(){var a=b
.previous,d=a.prevEffect, |
| 38 e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left
"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===
d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset
").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEar
ly:!0,css:{},locked:!0},overlay:null,fixed:!1,create:function(){this.overlay&&th
is.close();this.overlay=f('<div class="fancybox-overlay"></div>').appendTo(this.
el||"body");this.fixed= |
| 39 !1;b.defaults.fixed&&!r&&(this.overlay.addClass("fancybox-overlay-fixed"),this.f
ixed=!0)},open:function(a){var d=this,a=f.extend({},this.defaults,a);this.overla
y?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create();thi
s.fixed||(p.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.cl
oseClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fa
ncybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).sho
w()},close:function(){f(".fancybox-overlay").remove(); |
| 40 p.unbind("resize.overlay");this.overlay=null},update:function(){var a="100%",b;t
his.overlay.width(a).height("100%");f.browser.msie?(b=Math.max(y.documentElement
.offsetWidth,y.body.offsetWidth),m.width()>b&&(a=m.width())):m.width()>p.width()
&&(a=m.width());this.overlay.width(a).height(m.height())},onReady:function(a,b){
f(".fancybox-overlay").stop(!0,!0);this.overlay||(this.margin=m.height()>p.heigh
t()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,thi
s.el=y.all&&!y.querySelector? |
| 41 f("html"):f("body"),this.create());a.locked&&this.fixed&&(b.locked=this.overlay.
append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,argument
s)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==t
his.margin&&f("body").css("margin-right",k(this.margin)+b.scrollbarWidth));this.
open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){v
ar d=this,a=a.speedOut;d.overlay&&!b.isActive&&d.overlay.fadeOut(a||0,function()
{!1!==d.margin&&f("body").css("margin-right", |
| 42 d.margin);d.el.removeClass("fancybox-lock");d.close()})}};b.helpers.title={defau
lts:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.
title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(n(e)&&""!==f.trim(e))
{d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch
(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.i
nner;break;default:c=b.skin,d.appendTo("body"),f.browser.msie&&d.width(d.width()
),d.wrapInner('<span class="child"></span>'), |
| 43 b.current.margin[2]+=Math.abs(k(d.css("margin-bottom")))}d["top"===a.position?"p
rependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.sel
ector||"",j=function(g){var h=f(this).blur(),i=d,j,k;!g.ctrlKey&&(!g.altKey&&!g.
shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(j=a.groupAttr||"data-fancybox-g
roup",k=h.attr(j),k||(j="rel",k=h.get(0)[j]),k&&(""!==k&&"nofollow"!==k)&&(h=c.l
ength?f(c):e,h=h.filter("["+j+'="'+k+'"]'),i=h.index(this)),a.index=i,!1!==b.ope
n(h,a)&&g.preventDefault())}, |
| 44 a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-s
tart",j):m.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fan
cybox-nav')","click.fb-start",j);return this};m.ready(function(){f.scrollbarWidt
h===q&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;
overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b
.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===q){v
ar a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("bod
y"), |
| 45 e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend
(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,par
ent:f("body")})})})(window,document,jQuery); |
OLD | NEW |