HTML5 3D Flipping Gallery Support Product Page

Solved

There is a syntax error on line 18 of dmx3DFlipgallery.js in dreamwaever

Reported 27 Dec 2012 14:24:23
1
has this problem
27 Dec 2012 14:24:23 Michael Carbonara posted:
I keep seeing this error in dreamweaver. The code still works but I am concerned.

The JS File does not look normal. It is not properly formatted.

/*
HTML5 3D Flipping Gallery
Version: 1.0.1
(c) 2012 DMXzone.com
@build 28-11-2012 13:01:25
*/
(function(c){function i(a){for(var c=document.createElement("div".style,d=["","-webkit","-moz","-o","-ms"],h=["","Webkit","Moz","O","ms"],l=0;l<h.length;l++)if(h[l]+a in c)return d[l]+a.replace(/([A-Z])/g,"-$1".toLowerCase();return!1}var s={animationDuration:400,rotation:"random",maxRotation:10,random:!1,shuffle:!1,zoomTrigger:"hover",zoomFactor:1.2,flipTrigger:"click",flipEffect:"default",flipDirection:"left",flipRotation:0,singleActive:!0,perspective:800},y="dmx3DFlipGallery",p="dmx3DFlipPhoto",
q="dmx3DFlipPhotoActive",z="dmx3DFlipPhotoWrapper",D="dmx3DFlipPhotoFront",o="dmx3DFlipPhotoBack",t="dmx3DFlipPhotoFlipped",r=i("Transition",d=i("Transform",E=i("TransformOrigin",A=i("Perspective",u=i("TransformStyle",F=i("BackfaceVisibility",k=!1!==A,h=!0==k;c(function(){if(k&&"webkitPerspective"in c("body".get(0).style){var a=c('<div id="csstransform3d"></div>'),d=c('<style media="(transform-3d),(-webkit-transform-3d)">div#csstransform3d{position:absolute;left:9px;height:3px;}</style>');
c("body".append(a);c("head".append(d);k=9===a[0].offsetLeft&&3===a[0].offsetHeight;a.remove();d.remove()}h&&(a=c('<div style="'+u+': preserve-3d;"></div>'),c("body".append(a),h="preserve-3d"==a.css(u).toLowerCase(),a.remove())});c.fn.dmx3DFlipGallery=function(a){function f(c){var d=c.data("translate"||[0,0],f=c.data("scale"||1,i=c.data("rotateX"||0,n=c.data("rotateY"||0,c=c.data("rotateZ"||c.data("rotate"||0;/^\d+$/.test(d[0])&&(d[0]+="px";/^\d+$/.test(d[1])&&(d[1]+="px";return k?(h?"":
"perspective("+a.perspective+"px) "+"translate3D("+d[0]+","+d[1]+",0px) scale("+f+" rotateX("+i+"deg) rotateY("+n+"deg) rotateZ("+c+"deg)":"translate("+d[0]+"px,"+d[1]+"px) scale("+f+" rotate("+c+"deg)"}var a=c.extend({},s,a),n=Math.random,i=Math.floor;return this.each(function(){function l(){var e=!0;j.find("img".each(function(){if(0==this.width||0==this.height)e=!1});e?(j.find("img".mousedown(function(c){c.preventDefault()}),k?(/^top|bottom$/i.test(a.flipDirection)?c("."+o).data("rotateX",
180):c("."+o).data("rotateY",180),c("."+o).each(function(){c(this).css(d,f(c(this).parent())+" "+f(c(this)))}),c("."+D).css(d,f(c(this).parent())+" "+f(c(this)))):c("."+o).hide(),g.each(function(){var b=c(this),e=b.width(),j=b.height(),m=b.wrap('<div class="'+z+'" />').parent();if(k){if(h){m.css(A,a.perspective+"px";b.css(u,"preserve-3d"}b.children().css(F,"hidden";if(a.flipEffect=="slide"&&h){var g="center center";switch(a.flipDirection){case "top":g="center top";break;case "left":g="left center";
break;case "bottom":g="center bottom";break;case "right":g="right center"}b.css(E,g)}}b.data("rotation",b.data("rotation"||a.rotation);b.data("rotation"=="random"&&b.data("rotation",i(n()*(a.maxRotation*2+1))-a.maxRotation);d&&m.data("rotate",parseInt(b.data("rotation"));if(a.shuffle){e=i(n()*(s-e));j=i(n()*(G-j));m.css("position","absolute";m.css({left:e,top:j})}else m.css({position:"relative",display:"inline-block"});if(d){m.css(d,f(m));b.css(d,f(b))}}),r&&(g.css(r,d+" "+a.animationDuration+
"ms".parent().css(r,d+" "+a.animationDuration+"ms",k&&!h&&g.children().css(r,d+" "+a.animationDuration+"ms"),a.random&&(g.shuffle(),g=j.find("."+p)),j.on("fakeclick","."+p,function(){var b=c(this);if(a.zoomTrigger=="click"{d&&(b.data("scale"==1?B(b):w(b));a.singleActive&&w(g.not(b).filter("."+q))}if(a.flipTrigger=="click"{b.hasClass(t)?x(b):C(b);a.singleActive&&x(g.not(b).filter("."+q))}a.singleActive&&g.not(b).filter("."+q).removeClass(q);b.addClass(q)}).on("mouseenter","."+p,function(){var b=
c(this);a.zoomTrigger=="hover"&&B(b);a.flipTrigger=="hover"&&C(b)}).on("mouseleave","."+p,function(){var b=c(this);a.zoomTrigger=="hover"&&w(b);a.flipTrigger=="hover"&&x(b)}).on("mousedown touchstart","."+z,function(b){if(b.type=="touchstart"{b.preventDefault();b=b.originalEvent.touches[0]}var e=c(this),d=false,f=e.position(),h=b.pageX-f.left,g=b.pageY-f.top;v(e);if(a.shuffle)c("body".on("mousemove.dmx3DFlipGallery touchmove.dmx3DFlipGallery",function(c){c.type=="touchmove"&&(c=c.originalEvent.touches[0]);
d=true;e.css({left:c.pageX-h,top:c.pageY-g})});c("body".on("mouseup.dmx3DFlipGallery touchend.dmx3DFlipGallery",function(a){c("body".off(".dmx3DFlipGallery";if(!d){if(a.type=="touchend"&&a.srcElement){var b=a.originalEvent,f=document.createEvent("MouseEvents";f.initMouseEvent("click",true,true,b.view,1,b.changedTouches?b.changedTouches[0].screenX:b.screenX,b.changedTouches?b.changedTouches[0].screenY:b.screenY,b.changedTouches?b.changedTouches[0].clientX:b.clientX,b.changedTouches?b.changedTouches[0].clientY:
b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,0,null);a.srcElement.dispatchEvent(f)}e.children().trigger("fakeclick"}})}),j.removeClass(y+"Loading"):setTimeout(l,100)}function v(a){var b,d=parseInt(a.css("z-index")||0;a.siblings().each(function(){b=parseInt(c(this).css("z-index")||0;d<=b&&(d=b+1)});a.css("z-index",d)}function B(e){d&&(e.data("scale",a.zoomFactor),k&&!h?e.children().each(function(){c(this).css(d,f(e)+" "+f(c(this)))}):e.css(d,f(e)));v(e.parent())}function w(a){d&&(a.data("scale",
1),k&&!h?a.children().each(function(){c(this).css(d,f(a)+" "+f(c(this)))}):a.css(d,f(a)))}function x(e){var b=e.parent();e.removeClass(t);d&&b.data("rotate",e.data("rotation").css(d,f(b));k?("slide"==a.flipEffect&&h&&e.data("translate",[0,0]),/^top|bottom$/i.test(a.flipDirection)?e.data("rotateX",0):e.data("rotateY",0),h?e.css(d,f(e)):e.children().each(function(){c(this).css(d,f(e)+" "+f(c(this)))})):e.find("."+o).hide()}function C(e){var b=e.parent();e.addClass(t);d&&("random"==a.flipRotation?b.data("rotate",
i(n()*(2*a.maxRotation+1))-a.maxRotation).css(d,f(b)):"none"!=a.flipRotation&&b.data("rotate",parseInt(a.flipRotation)).css(d,f(b)));if(k){var g=/^top|left$/i.test(a.flipDirection)?-180:180;if("slide"==a.flipEffect&&h)switch(a.flipDirection){case "top":e.data("translate",[0,"100%"]);break;case "left":e.data("translate",["100%",0]);break;case "bottom":e.data("translate",[0,"-100%"]);break;case "right":e.data("translate",["-100%",0])}/^top|bottom$/i.test(a.flipDirection)?e.data("rotateX",g):e.data("rotateY",
g);h?e.css(d,f(e)):e.children().each(function(){c(this).css(d,f(e)+" "+f(c(this)))})}else e.find("."+o).show();v(b)}var j=c(this),g=j.find("."+p),s=j.width(),G=j.height();j.addClass(y+"Loading";l()})};c.fn.shuffle=function(){var a=this.get(),d=c.map(a,function(){var d=Math.floor(Math.random()*a.length),f=c(a[d]).clone(!0)[0];a.splice(d,1);return f});this.each(function(a){c(this).replaceWith(c(d[a]))});return c(d)}})(window.jQuery||window.Zepto);

Replies

Replied 07 Feb 2013 10:24:43
07 Feb 2013 10:24:43 Miroslav Zografski replied:
Hello Michael,

can you, please, provide a link to the page where you get that error? Thanks.

Regards.

Reply to this topic