Author Topic: Lightbox/ Slimbox problem  (Read 3978 times)

Vlada_bgd

  • Jr. Member
  • **
  • Posts: 64
Lightbox/ Slimbox problem
« on: July 31, 2010, 03:03:32 am »
VM!1.1.5 & Joomla 1.5.20
I have updated slimbox to 1.6 version:
Code: [Select]
/*
Slimbox v1.6 - The ultimate lightweight Lightbox clone
(c) 2007-2008 Christophe Beyls <http://www.digitalia.be>
MIT-style license.
*/
var Slimbox;(function(){var G=0,F,L,B,O,E,M,I=new Image(),K=new Image(),V,Y,P,H,U,X,J,W,C;window.addEvent("domready",function(){$(document.body).adopt($$([V=new Element("div",{id:"lbOverlay"}),Y=new Element("div",{id:"lbCenter"}),X=new Element("div",{id:"lbBottomContainer"})]).setStyle("display","none"));P=new Element("div",{id:"lbImage"}).injectInside(Y).adopt(H=new Element("a",{id:"lbPrevLink",href:"#"}),U=new Element("a",{id:"lbNextLink",href:"#"}));H.onclick=D;U.onclick=R;var a;J=new Element("div",{id:"lbBottom"}).injectInside(X).adopt(a=new Element("a",{id:"lbCloseLink",href:"#"}),W=new Element("div",{id:"lbCaption"}),C=new Element("div",{id:"lbNumber"}),new Element("div",{styles:{clear:"both"}}));a.onclick=V.onclick=N;E={overlay:new Fx.Tween(V,{property:"opacity",duration:500}).set(0),image:new Fx.Tween(P,{property:"opacity",duration:500,onComplete:A}),bottom:new Fx.Tween(J,{property:"margin-top",duration:400})}});Slimbox={open:function(c,b,a){F=$extend({overlayOpacity:0.8,resizeDuration:400,re sizeTransition:false,initialWidth:250,initialHeight:250,animateCaption:true,showCounter:true,counter Text:"Image {x} of {y}"},a||{});if(typeof c=="string"){c=[[c,b]];b=0}L=c;Z();Q(true);O=window.getScrollTop()+(window.getHeight()/15);E.resize=new Fx.Morph(Y,$extend({duration:F.resizeDuration,onComplete:A},F.resizeTransition?{transition:F.resizeT ransition}:{}));Y.setStyles({top:O,width:F.initialWidth,height:F.initialHeight,marginLeft:-(F.initialWidth/2),display:""});E.overlay.start(F.overlayOpacity);return S(b)}};Element.implement({slimbox:function(a,b){$$(this).slimbox(a,b)}});Elements.implement({slimbox :function(a,d,c){d=d||function(e){return[e.href,e.title]};c=c||function(){return true};var b=this;b.forEach(function(e){e.onclick=function(){var f=b.filter(c,this);return Slimbox.open(f.map(d),f.indexOf(this),a)}})}});function Z(){V.setStyles({top:window.getScrollTop(),height:window.getHeight()})}function Q(a){$$("object",Browser.Engine.trident?"select":"embed").forEach(function(c){if(a){c.slimbox=c.style.visibility}c.style.visibility=a?"hidden":c.slimbox});V.style.display=a?"":"none";var b=a?"addEvent":"removeEvent";window[b]("scroll",Z)[b]("resize",Z);document[b]("keydown",T)}function T(a){switch(a.code){case 27:case 88:case 67:N();break;case 37:case 80:D();break;case 39:case 78:R()}return false}function D(){return S(B-1)}function R(){return S(B+1)}function S(a){if((G>1)||(a<0)||(a>=L.length)){return false}G=2;B=a;$$(H,U,P,X).setStyle("display","none");E.bottom.cancel().set(0);E.image.set(0);Y.className="lbLoading";M=new Image();M.onload=A;M.src=L[a][0];return false}function A(){switch(G++){case 2:Y.className="";P.setStyles({backgroundImage:"url("+L[B][0]+")",display:""});$$(P,J).setStyle("width",M.width);$$(P,H,U).setStyle("height",M.height);W.set("html",L[B][1]||"");C.set("html",(F.showCounter&&(L.length>1))?F.counterText.replace(/{x}/,B+1).replace(/{y}/,L.length):"");if(B){I.src=L[B-1][0]}if(B!=(L.length-1)){K.src=L[B+1][0]}if(Y.clientHeight!=P.offsetHeight){E.resize.start({height:P.offsetHeight});break}G++;case 3:if(Y.clientWidth!=P.offsetWidth){E.resize.start({width:P.offsetWidth,marginLeft:-P.offsetWidth/2});break}G++;case 4:X.setStyles({top:O+Y.clientHeight,height:0,marginLeft:Y.style.marginLeft,display:""});E.image.start(1);break;case 5:if(B){H.style.display=""}if(B<(L.length-1)){U.style.display=""}if(F.animateCaption){E.bottom.set(-J.offsetHeight).start(0)}X.style.height="";G=1}}function N(){if(!G){return false}G=0;M.onload=$empty;for(var a in E){E[a].cancel()}$$(Y,X).setStyle("display","none");E.overlay.chain(Q).start(0);return false}})();

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
var links = $$("a").filter(function(el) {
return el.rel && el.rel.test(/^lightbox/i);
});
// PUT YOUR CUSTOM OPTIONS INSIDE THE FOLLOWING {}
$$(links).slimbox({}, null, function(el) {
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
};
window.addEvent("domready", Slimbox.scanPage);
But now I get this error:
Code: [Select]
missing : after property id
[Break on this error] var Slimbox;(function(){var G=0,F,L,B,...chain(Q).start(0);return false}})();
slimbox.js (line 6)
And before, I couldn't get lightbox to work.