Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Signed-off-by: jack <jack@colorpowered.com>

  • Loading branch information...
commit 5736159175693b823d98752c4c11481cc6ae1700 1 parent 0325eec
jack authored
Showing with 16 additions and 20 deletions.
  1. +1 −6 colorbox/jquery.colorbox-min.js
  2. +15 −14 colorbox/jquery.colorbox.js
View
7 colorbox/jquery.colorbox-min.js
@@ -1,6 +1 @@
-/*
- ColorBox v1.2.0 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
- (c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com
- Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-*/
-document.write("\r\n<style type='text/css'>\r\n#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}\r\n#cboxOverlay{position:fixed; width:100%; height:100%;}\r\n#cboxMiddleLeft, #cboxBottomLeft{clear:left;}\r\n#cboxContent{position:relative; overflow:visible;}\r\n#cboxLoadedContent{overflow:auto; width:0; height:0;}\r\n#cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}\r\n#cboxTitle{margin:0;}\r\n#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}\r\n#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}\r\n</style>\r\n");(function(g){var D,h,k,c,q,a,j,G,z,w,s,e,C,A,d,u,p,v,x,m,i,f,F,t,b,l,E;function n(){i.css({position:"absolute",width:s.width(),height:s.height(),top:s.scrollTop(),left:s.scrollLeft()})}function o(){var H;function I(){w.text(D.slideshowStop).bind("cbox_complete",function(){z=setTimeout(g.fn.colorbox.next,D.slideshowSpeed)}).bind("cbox_load",function(){clearTimeout(z)}).one("click",function(){H();g(this).removeClass("hover")});p.removeClass("cboxSlideshow_off").addClass("cboxSlideshow_on")}H=function(){clearTimeout(z);w.text(D.slideshowStart).unbind("cbox_complete cbox_load").one("click",function(){I();z=setTimeout(g.fn.colorbox.next,D.slideshowSpeed);g(this).removeClass("hover")});p.removeClass("cboxSlideshow_on").addClass("cboxSlideshow_off")};if(D.slideshow!==false&&G.length>1){if(D.slideshowAuto===true){I()}else{H()}}}function r(){if(g("#cboxInlineTemp").length>0){F.children().insertAfter("#cboxInlineTemp")}}function B(H,I){return(typeof H=="string")?(H.match(/%/)?(I/100)*parseInt(H,10):parseInt(H,10)):H}function y(H){return H.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i)}g(function(){g.fn.colorbox.init()});g.fn.colorbox=function(I,H){g(this).unbind("click.colorbox").bind("click.colorbox",function(J){this.blur();D=g.extend({},g.fn.colorbox.settings,I);if(H){h=H}else{h=function(){}}if(D.width){D.width=B(D.width,document.documentElement.clientWidth)}if(D.height){D.height=B(D.height,document.documentElement.clientHeight)}if(this.rel&&"nofollow"!=this.rel){G=g("a[rel='"+this.rel+"']");j=g(G).index(this)}else{G=g(this);j=0}if(p.data("open")!==true){g.event.trigger("cbox_open");e.html(D.close);i.css({opacity:D.opacity}).show();p.data("open",true);g.fn.colorbox.position(B(D.initialWidth,document.documentElement.clientWidth),B(D.initialHeight,document.documentElement.clientHeight),0);if(g.browser.msie&&g.browser.version<7){s.bind("resize scroll",n)}}o();g.fn.colorbox.load();if(D.overlayClose===true){i.css({cursor:"pointer"}).click(g.fn.colorbox.close)}J.preventDefault()});if(I&&I.open&&p.data("open")!==true){g(this).triggerHandler("click.colorbox")}return this.each(function(){})};g.fn.colorbox.init=function(){s=g(window);g("body").prepend(i=g('<div id="cboxOverlay" />').hide(),p=g('<div id="colorbox" />'));v=g('<div id="cboxWrapper" />').appendTo(p).append(g("<div/>").append(g('<div id="cboxTopLeft"/>'),t=g('<div id="cboxTopCenter"/>'),g('<div id="cboxTopRight"/>')),b=g('<div id="cboxMiddleLeft" />'),f=g('<div id="cboxContent" />'),l=g('<div id="cboxMiddleRight" />'),g("<div/>").append(g('<div id="cboxBottomLeft"/>'),E=g('<div id="cboxBottomCenter"/>'),g('<div id="cboxBottomRight"/>')));v.find("[id]").css({"float":"left"});f.append(F=g('<div id="cboxLoadedContent" />'),x=g('<div id="cboxLoadingOverlay" />'),m=g('<div id="cboxLoadingGraphic" />'),u=g('<div id="cboxTitle" />'),d=g('<div id="cboxCurrent" />'),w=g('<div id="cboxSlideshow" />'),C=g('<div id="cboxNext" />').click(g.fn.colorbox.next),A=g('<div id="cboxPrevious" />').click(g.fn.colorbox.prev),e=g('<div id="cboxClose" />').click(g.fn.colorbox.close));f.children().addClass("hover").mouseover(function(){g(this).addClass("hover")}).mouseout(function(){g(this).removeClass("hover")}).hide();q=t.height()+E.height()+f.outerHeight(true)-f.height();a=b.width()+l.width()+f.outerWidth(true)-f.width();c=F.outerHeight(true);k=F.outerWidth(true);p.css({"padding-bottom":q,"padding-right":a}).hide();g().bind("keydown.cbox_close",function(H){if(H.keyCode==27){H.preventDefault();e.click()}});f.children().removeClass("hover")};g.fn.colorbox.next=function(){j=j<G.length-1?j+1:0;g.fn.colorbox.load()};g.fn.colorbox.prev=function(){j=j>0?j-1:G.length-1;g.fn.colorbox.load()};g.fn.colorbox.position=function(K,J,I,L){var M=document.documentElement.clientHeight;var O=M/2-J/2;var N=document.documentElement.clientWidth/2-K/2;if(J>M){O-=(J-M)}if(O<0){O=0}if(N<0){N=0}O+=s.scrollTop();N+=s.scrollLeft();K=K-a;J=J-q;v[0].style.width=v[0].style.height="9999px";function P(Q){t[0].style.width=E[0].style.width=f[0].style.width=Q.style.width;m[0].style.height=x[0].style.height=f[0].style.height=b[0].style.height=l[0].style.height=Q.style.height}var H=(p.width()===K&&p.height()===J)?0:I;p.dequeue().animate({height:J,width:K,top:O,left:N},{duration:H,complete:function(){P(this);v[0].style.width=(K+a)+"px";v[0].style.height=(J+q)+"px";if(L){L()}if(g.browser.msie&&g.browser.version<7){n()}},step:function(){P(this)}})};g.fn.colorbox.dimensions=function(J){s.unbind("resize.cbox_resize");if(p.data("open")!==true){return false}var M=D.transition=="none"?0:D.speed;F.remove();F=g(J);F.hide().appendTo("body").css({width:(D.width)?D.width-k-a:F.width()}).css({height:(D.height)?D.height-c-q:F.height()}).attr({id:"cboxLoadedContent"}).prependTo(f);if(g.browser.msie&&g.browser.version<7){g("select").not(g("#colorbox select")).css({visibility:"hidden"})}if(g("#cboxPhoto").length>0&&D.height){var I=(parseInt(F[0].style.height,10)-parseInt(g("#cboxPhoto")[0].style.height,10))/2;g("#cboxPhoto").css({marginTop:(I>0?I:0)})}function H(O){var N=parseInt(F[0].style.width,10)+k+a;var P=parseInt(F[0].style.height,10)+c+q;g.fn.colorbox.position(N,P,O,function(){if(p.data("open")!==true){return false}f.children().show();x.hide();m.hide();w.hide();u.html(D.title?D.title:G[j].title);if(G.length>1){d.html(D.current.replace(/\{current\}/,j+1).replace(/\{total\}/,G.length));C.html(D.next);A.html(D.previous);g().unbind("keydown.cbox_key").one("keydown.cbox_key",function(Q){if(Q.keyCode==37){Q.preventDefault();A.click()}else{if(Q.keyCode==39){Q.preventDefault();C.click()}}});if(D.slideshow!==false){w.show()}}else{d.add(C).add(A).hide()}g("#cboxIframe").attr("src",g("#cboxIframe").attr("src"));g.event.trigger("cbox_complete");h();if(D.transition==="fade"){p.fadeTo(M,1)}s.bind("resize.cbox_resize",function(){g.fn.colorbox.position(N,P,0)});return true})}if(D.transition=="fade"){p.fadeTo(M,0,function(){H(0)})}else{H(M)}if(D.preloading!==false&&G.length>1&&y(G[j].href)){var L,K;L=j>0?G[j-1].href:G[G.length-1].href;K=j<G.length-1?G[j+1].href:G[0].href;return[g("<img />").attr("src",K),g("<img />").attr("src",L)]}return true};g.fn.colorbox.load=function(){g.event.trigger("cbox_load");x.show();m.show();e.show();r();var H=D.href?D.href:G[j].href;if(D.inline){g('<div id="cboxInlineTemp" />').hide().insertBefore(g(H)[0]);g.fn.colorbox.dimensions(g(H).wrapAll("<div />").parent())}else{if(D.iframe){g.fn.colorbox.dimensions(g("<div><iframe id='cboxIframe' name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+H+"' /></div>"))}else{if(y(H)){var I=new Image();I.onload=function(){I.onload=null;g.fn.colorbox.dimensions(g("<div />").css({width:this.width,height:this.height}).append(g(this).css({width:this.width,height:this.height,display:"block",margin:"auto"}).attr("id","cboxPhoto")));if(G.length>1){g(this).css({cursor:"pointer"}).click(g.fn.colorbox.next)}};I.src=H}else{g("<div />").load(H,function(J,K){if(K=="success"){g.fn.colorbox.dimensions(g(this))}else{g.fn.colorbox.dimensions(g("<p>Request unsuccessful.</p>"))}})}}}};g.fn.colorbox.close=function(){clearTimeout(z);s.unbind("resize.cbox_resize");w.unbind("cbox_complete cbox_load click");r();i.css({cursor:"auto"}).fadeOut("fast").unbind("click",g.fn.colorbox.close);g().unbind("keydown.cbox_key");if(g.browser.msie&&g.browser.version<7){g("select").css({visibility:"inherit"});s.unbind("resize scroll",n)}f.children().hide();p.stop(true,false).removeClass().fadeOut("fast",function(){F.remove();p.removeData("open").css({opacity:1});g.event.trigger("cbox_closed")})};g.fn.colorbox.settings={transition:"elastic",speed:350,initialWidth:"400",initialHeight:"400",width:false,height:false,inline:false,iframe:false,href:false,title:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow"}})(jQuery);
+(function(u){var G,z,r,E,a,c,J,e,t,g,A,D,F,n,h,y,i,f,H,I,b,m,x,d,v,j,B,o,q;function s(){x.css({position:"absolute",width:F.width(),height:F.height(),top:F.scrollTop(),left:F.scrollLeft()})}function l(){var K;function L(){D.text(G.slideshowStop).bind("cbox_complete",function(){A=setTimeout(u.fn.colorbox.next,G.slideshowSpeed)}).bind("cbox_load",function(){clearTimeout(A)}).one("click",function(){K();u(this).removeClass("hover")});H.removeClass("cboxSlideshow_off").addClass("cboxSlideshow_on")}K=function(){clearTimeout(A);D.text(G.slideshowStart).unbind("cbox_complete cbox_load").one("click",function(){L();A=setTimeout(u.fn.colorbox.next,G.slideshowSpeed);u(this).removeClass("hover")});H.removeClass("cboxSlideshow_on").addClass("cboxSlideshow_off")};if(G.slideshow!==false&&g.length>1){if(G.slideshowAuto===true){L()}else{K()}}}function k(){if(u("#cboxInlineTemp").length>0){v.children().insertAfter("#cboxInlineTemp")}}function C(K){if(K.keyCode==37){K.preventDefault();y.click()}else{if(K.keyCode==39){K.preventDefault();h.click()}}}function w(K,L){L=L=="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return(typeof K=="string")?(K.match(/%/)?(L/100)*parseInt(K,10):parseInt(K,10)):K}function p(K){return K.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i)}u(function(){u.fn.colorbox.init()});u.fn.colorbox=function(L,K){u(this).unbind("click.colorbox").bind("click.colorbox",function(N){this.blur();G=u.extend({},u.fn.colorbox.settings,L);if(K){var M=this;z=function(){u(M).each(K)}}else{z=function(){}}if(G.width){G.width=w(G.width,"x")}if(G.height){G.height=w(G.height,"y")}if(this.rel&&"nofollow"!=this.rel){g=u("a[rel='"+this.rel+"']");t=u(g).index(this)}else{g=u(this);t=0}if(H.data("open")!==true){u.event.trigger("cbox_open");n.html(G.close);x.css({opacity:G.opacity}).show();H.data("open",true);u.fn.colorbox.position(w(G.initialWidth,"x"),w(G.initialHeight,"y"),0);if(u.browser.msie&&u.browser.version<7){F.bind("resize scroll",s)}}l();u.fn.colorbox.load();if(G.overlayClose===true){x.css({cursor:"pointer"}).click(u.fn.colorbox.close)}N.preventDefault()});if(L&&L.open&&H.data("open")!==true){u(this).triggerHandler("click.colorbox")}return this.each(function(){})};u.fn.colorbox.init=function(){F=u(window);u("body").prepend(x=u('<div id="cboxOverlay" />').hide(),H=u('<div id="colorbox" />'));I=u('<div id="cboxWrapper" />').appendTo(H).append(u("<div/>").append(u('<div id="cboxTopLeft"/>'),j=u('<div id="cboxTopCenter"/>'),u('<div id="cboxTopRight"/>')),B=u('<div id="cboxMiddleLeft" />'),d=u('<div id="cboxContent" />'),o=u('<div id="cboxMiddleRight" />'),u("<div/>").append(u('<div id="cboxBottomLeft"/>'),q=u('<div id="cboxBottomCenter"/>'),u('<div id="cboxBottomRight"/>')));I.find("[id]").css({"float":"left"});d.append(v=u('<div id="cboxLoadedContent" />'),b=u('<div id="cboxLoadingOverlay" />'),m=u('<div id="cboxLoadingGraphic" />'),f=u('<div id="cboxTitle" />'),i=u('<div id="cboxCurrent" />'),D=u('<div id="cboxSlideshow" />'),h=u('<div id="cboxNext" />').click(u.fn.colorbox.next),y=u('<div id="cboxPrevious" />').click(u.fn.colorbox.prev),n=u('<div id="cboxClose" />').click(u.fn.colorbox.close));d.children().addClass("hover").mouseover(function(){u(this).addClass("hover")}).mouseout(function(){u(this).removeClass("hover")}).hide();J=j.height()+q.height()+d.outerHeight(true)-d.height();e=B.width()+o.width()+d.outerWidth(true)-d.width();c=v.outerHeight(true);a=v.outerWidth(true);H.css({"padding-bottom":J,"padding-right":e}).hide();u().bind("keydown.cbox_close",function(K){if(K.keyCode==27){K.preventDefault();n.click()}});d.children().removeClass("hover")};u.fn.colorbox.next=function(){t=t<g.length-1?t+1:0;u.fn.colorbox.load()};u.fn.colorbox.prev=function(){t=t>0?t-1:g.length-1;u.fn.colorbox.load()};u.fn.colorbox.position=function(N,M,L,O){var P=document.documentElement.clientHeight;var R=P/2-M/2;var Q=document.documentElement.clientWidth/2-N/2;if(M>P){R-=(M-P)}if(R<0){R=0}if(Q<0){Q=0}R+=F.scrollTop();Q+=F.scrollLeft();N=N-e;M=M-J;I[0].style.width=I[0].style.height="9999px";function S(T){j[0].style.width=q[0].style.width=d[0].style.width=T.style.width;m[0].style.height=b[0].style.height=d[0].style.height=B[0].style.height=o[0].style.height=T.style.height}var K=(H.width()===N&&H.height()===M)?0:L;H.dequeue().animate({height:M,width:N,top:R,left:Q},{duration:K,complete:function(){S(this);I[0].style.width=(N+e)+"px";I[0].style.height=(M+J)+"px";if(O){O()}if(u.browser.msie&&u.browser.version<7){s()}},step:function(){S(this)}})};u.fn.colorbox.dimensions=function(N){F.unbind("resize.cbox_resize");if(H.data("open")!==true){return false}var Q=G.transition=="none"?0:G.speed;v.remove();v=u(N);function K(){var S=G.width?G.width-a-e:v.width();if(r&&r<S){S=r}return S}function R(){var S=G.height?G.height-c-J:v.height();if(E&&E<S){S=E}return S}v.hide().appendTo("body").css({width:K()}).css({height:R()}).attr({id:"cboxLoadedContent"}).prependTo(d);if(u.browser.msie&&u.browser.version<7){u("select").not(u("#colorbox select")).css({visibility:"hidden"})}if(u("#cboxPhoto").length>0&&G.height){var M=(v.height()-parseInt(u("#cboxPhoto")[0].style.height,10))/2;u("#cboxPhoto").css({marginTop:(M>0?M:0)})}function L(T){var S=v.width()+a+e;var U=v.height()+c+J;u.fn.colorbox.position(S,U,T,function(){if(H.data("open")!==true){return false}d.children().show();b.hide();m.hide();D.hide();f.html(G.title?G.title:g[t].title);if(g.length>1){i.html(G.current.replace(/\{current\}/,t+1).replace(/\{total\}/,g.length));h.html(G.next);y.html(G.previous);u().unbind("keydown",C).one("keydown",C);if(G.slideshow!==false){D.show()}}else{i.add(h).add(y).hide()}u("#cboxIframe").attr("src",u("#cboxIframe").attr("src"));u.event.trigger("cbox_complete");z();if(G.transition==="fade"){H.fadeTo(Q,1)}F.bind("resize.cbox_resize",function(){u.fn.colorbox.position(S,U,0)});return true})}if(G.transition=="fade"){H.fadeTo(Q,0,function(){L(0)})}else{L(Q)}if(G.preloading!==false&&g.length>1&&p(g[t].href)){var P,O;P=t>0?g[t-1].href:g[g.length-1].href;O=t<g.length-1?g[t+1].href:g[0].href;return[u("<img />").attr("src",O),u("<img />").attr("src",P)]}return true};u.fn.colorbox.load=function(){u.event.trigger("cbox_load");b.show();m.show();n.show();k();r=G.maxWidth?w(G.maxWidth,"x")-a-e:false;E=G.maxHeight?w(G.maxHeight,"y")-c-J:false;var K=G.href?G.href:g[t].href;if(G.inline){u('<div id="cboxInlineTemp" />').hide().insertBefore(u(K)[0]);u.fn.colorbox.dimensions(u(K).wrapAll("<div />").parent())}else{if(G.iframe){u.fn.colorbox.dimensions(u("<div><iframe id='cboxIframe' name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+K+"' /></div>"))}else{if(p(K)){var L=new Image();L.onload=function(){L.onload=null;if(E||r){var O=this.width;var M=this.height;var Q=0;var P=this;function N(){M+=M*Q;O+=O*Q;P.height=M;P.width=O}if(r&&O>r){Q=(r-O)/O;N()}if(E&&M>E){Q=(E-M)/M;N()}}u.fn.colorbox.dimensions(u("<div />").css({width:this.width,height:this.height}).append(u(this).css({width:this.width,height:this.height,display:"block",margin:"auto"}).attr("id","cboxPhoto")));if(g.length>1){u(this).css({cursor:"pointer"}).click(u.fn.colorbox.next)}};L.src=K}else{u("<div />").load(K,function(M,N){if(N=="success"){u.fn.colorbox.dimensions(u(this))}else{u.fn.colorbox.dimensions(u("<p>Request unsuccessful.</p>"))}})}}}};u.fn.colorbox.close=function(){clearTimeout(A);F.unbind("resize.cbox_resize");D.unbind("cbox_complete cbox_load click");k();x.css({cursor:"auto"}).fadeOut("fast").unbind("click",u.fn.colorbox.close);u().unbind("keydown",C);if(u.browser.msie&&u.browser.version<7){u("select").css({visibility:"inherit"});F.unbind("resize scroll",s)}d.children().hide();H.stop(true,false).removeClass().fadeOut("fast",function(){v.remove();H.removeData("open").css({opacity:1});u.event.trigger("cbox_closed")})};u.fn.colorbox.settings={transition:"elastic",speed:350,width:false,height:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,resize:true,inline:false,iframe:false,href:false,title:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow"}})(jQuery);
View
29 colorbox/jquery.colorbox.js
@@ -5,7 +5,7 @@
*/
(function($){
- var settings, callback, loadedWidth, loadedHeight, interfaceHeight, interfaceWidth, index, related, ssTimeout, $slideshow, $window, $close, $next, $prev, $current, $title, $modal, $wrap, $loadingOverlay, $loadingGraphic, $overlay, $modalContent, $loaded, $borderTopCenter, $borderMiddleLeft, $borderMiddleRight, $borderBottomCenter;
+ var settings, callback, maxWidth, maxHeight, loadedWidth, loadedHeight, interfaceHeight, interfaceWidth, index, related, ssTimeout, $slideshow, $window, $close, $next, $prev, $current, $title, $modal, $wrap, $loadingOverlay, $loadingGraphic, $overlay, $modalContent, $loaded, $borderTopCenter, $borderMiddleLeft, $borderMiddleRight, $borderBottomCenter;
/* Helper Functions */
//function for IE6 to set the background overlay
@@ -70,6 +70,7 @@
// Convert % values to pixels
function setSize(size, dimension){
+ dimension = dimension=='x' ? document.documentElement.clientWidth : document.documentElement.clientHeight;
return (typeof size == 'string') ? (size.match(/%/) ? (dimension/100)*parseInt(size, 10) : parseInt(size, 10)) : size;
}
@@ -98,8 +99,8 @@
callback = function(){};
}
- if(settings.width){ settings.width = setSize(settings.width, document.documentElement.clientWidth);}
- if(settings.height){ settings.height = setSize(settings.height, document.documentElement.clientHeight);}
+ if(settings.width){ settings.width = setSize(settings.width, 'x');}
+ if(settings.height){ settings.height = setSize(settings.height, 'y');}
if (this.rel && 'nofollow' != this.rel) {
related = $("a[rel='" + this.rel + "']");
@@ -113,7 +114,7 @@
$close.html(settings.close);
$overlay.css({"opacity": settings.opacity}).show();
$modal.data("open", true);
- $.fn.colorbox.position(setSize(settings.initialWidth, document.documentElement.clientWidth), setSize(settings.initialHeight, document.documentElement.clientHeight), 0);
+ $.fn.colorbox.position(setSize(settings.initialWidth, 'x'), setSize(settings.initialHeight, 'y'), 0);
if ($.browser.msie && $.browser.version < 7) {
$window.bind("resize scroll", IE6Overlay);
}
@@ -131,7 +132,11 @@
$(this).triggerHandler('click.colorbox');
}
- return this.each(function(){});
+ return this.each(function(){
+
+
+
+ });
};
/*
@@ -267,10 +272,7 @@
var speed = settings.transition=="none" ? 0 : settings.speed;
$loaded.remove();
$loaded = $(object);
-
- var maxWidth = settings.maxWidth ? setSize(settings.maxWidth) : false;
- var maxHeight = settings.maxHeight ? setSize(settings.maxHeight) : false;
-
+
function getWidth(){
var width = settings.width ? settings.width - loadedWidth - interfaceWidth:$loaded.width();
if(maxWidth && maxWidth < width){
@@ -365,6 +367,9 @@
$close.show();
clearInline();//puts inline elements back if they are being used
+ maxWidth = settings.maxWidth ? setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth : false;
+ maxHeight = settings.maxHeight ? setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight : false;
+
var href = settings.href ? settings.href : related[index].href;
if (settings.inline) {
@@ -379,10 +384,6 @@
loadingElement.onload = function(){
loadingElement.onload = null;
-
- /* Resizes the photo to fit within the maximum range */
- var maxWidth = settings.maxWidth ? setSize(settings.maxWidth) : false;
- var maxHeight = settings.maxHeight ? setSize(settings.maxHeight) : false;
if(maxHeight || maxWidth){
var width = this.width;
var height = this.height;
@@ -405,7 +406,7 @@
}
}
- $.fn.colorbox.dimensions($("<div />").css({width:this.width, height:this.height}).append($(this).css({width:this.width, height:this.height, display:"block", margin:"auto"}).attr('id', 'cboxPhoto')));
+ $.fn.colorbox.dimensions($("<div />").css({width:this.width, height:this.height}).append($(this).css({width:this.width, height:this.height, display:"block", margin:"auto", border:0}).attr('id', 'cboxPhoto')));
if(related.length > 1){
$(this).css({cursor:'pointer'}).click($.fn.colorbox.next);
}
Please sign in to comment.
Something went wrong with that request. Please try again.