Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

3D transformations are removed from the list of loaded transitions wh…

…en the browser does not support 3D
  • Loading branch information...
commit 88e8ba57c15ae623161e28d8824eff94eec1d155 1 parent e100c37
Joe Lambert authored
View
2  build/build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<build>
- <version>1.3beta</version>
+ <version>1.3a</version>
<outputname>flux</outputname>
<docroot>../js/</docroot>
<files>
View
2  change.log
@@ -14,6 +14,8 @@ Improved performance by using Document Fragments to reduce DOM reflows.
Added support for Modernizr feature detection with a fallback to custom detection code.
+3D transformations are removed from the list of loaded transitions when the browser does not support 3D
+
1.2.1 (2011/05/17)
------------------
Fixed a z-index issue with 'bars3d' under Chrome. This also reduced flicker during rendering on iOS.
View
30 compass/src/demo.scss
@@ -101,21 +101,21 @@ body
}
}
}
-
- footer
- {
- width: 100%;
- text-align: center;
- font-size: 0.7em;
- //text-shadow: 0 1px 0px rgba(#000, 0.5);
- margin-top: 4em;
- color: #666;
-
- p
- {
- margin-bottom: 2em;
- }
- }
+ }
+}
+
+footer
+{
+ width: 100%;
+ text-align: center;
+ font-size: 0.7em;
+ //text-shadow: 0 1px 0px rgba(#000, 0.5);
+ margin-top: 4em;
+ color: #666;
+
+ p
+ {
+ margin-bottom: 2em;
}
}
View
15 compass/src/style.scss
@@ -85,4 +85,19 @@ section#details
background: rgba(#FFF, 0.3);
}
}
+}
+
+footer
+{
+ div#carbonads-container
+ {
+ div.carbonad
+ {
+ background: #353535;
+ margin: 6em auto 3em;
+ border: 1px solid rgba(#FFF, 0.1);
+ @include border-radius(3px);
+ text-align: left;
+ }
+ }
}
View
2  css/demo.css
@@ -1 +1 @@
-html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline}body{line-height:1;color:black;background:white}ol,ul{list-style:none}table{border-collapse:separate;border-spacing:0;vertical-align:middle}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:"" ""}q:before,q:after,blockquote:before,blockquote:after{content:""}a img{border:none}section,article,aside,header,footer,nav,dialog,figure{display:block}*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}a{color:#CCC;text-decoration:none}html{background:#2F2F2F}body{background:#2F2F2F;min-height:100%;font-family:helvetica, arial, sans-serif;overflow-x:hidden;margin:0}body section.container{width:790px;margin:40px auto}body section.container h1{color:#DDD;font-size:3em;font-weight:bold;text-align:center;text-shadow:0 1px 0px #000;text-transform:lowercase;margin-bottom:0.2em}body section.container h2{font-size:0.8em;color:#666;text-align:center;margin-bottom:4em;text-shadow:0 1px 0px rgba(0, 0, 0, 0.5)}body section.container div#slider{-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:20px;background:rgba(0, 0, 0, 0.3);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(0, 0, 0, 0.9) inset}body section.container div#slider div.fluxslider div.images{width:100%;border:1px solid rgba(255, 255, 255, 0.1);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box}body section.container div#slider div.fluxslider ul.pagination{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:10px 0 !important;overflow:hidden}body section.container div#slider div.fluxslider ul.pagination li{text-indent:10000px;height:8px;width:8px;-moz-border-radius:10px;-webkit-border-radius:10px;-o-border-radius:10px;-ms-border-radius:10px;-khtml-border-radius:10px;border-radius:10px;background:rgba(0, 0, 0, 0.6);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1)}body section.container div#slider div.fluxslider ul.pagination li.current{background:rgba(255, 255, 255, 0.2)}body section.container footer{width:100%;text-align:center;font-size:0.7em;margin-top:4em;color:#666}body section.container footer p{margin-bottom:2em}body#transitiongallery section.container{width:960px}body#transitiongallery section.container div#slidercontainer{position:relative}body#transitiongallery section.container div#slidercontainer div#transitions{position:absolute;z-index:50;top:20px;right:20px;width:150px}body#transitiongallery section.container div#slidercontainer div#transitions h2{font-size:1em;text-align:left;color:#CCC;font-weight:bold;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul{margin-bottom:1.5em}body#transitiongallery section.container div#slidercontainer div#transitions ul li{font-size:0.8em;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul li a{display:block;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;padding:0.5em;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #444444), color-stop(100%, #333333));background-image:-moz-linear-gradient(top, #444444 0%, #333333 100%);border:1px solid rgba(255, 255, 255, 0.1);-webkit-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-moz-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-o-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;position:relative}body#transitiongallery section.container div#slidercontainer div#transitions ul li a:active{top:1px}body#transitiongallery section.container div#slidercontainer div#transitions ul li a.new:after{content:'New';font-size:0.8em;padding:0.2em 0.4em;color:#FFF;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dd4c10), color-stop(100%, #d23a13));background-image:-moz-linear-gradient(top, #dd4c10 0%, #d23a13 100%);border:1px solid #FFF;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;-moz-box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;-webkit-box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;-o-box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;position:absolute;top:-0.5em;right:-0.5em}
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}body{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}a{color:#CCC;text-decoration:none}html{background:#2F2F2F}body{background:#2F2F2F;min-height:100%;font-family:helvetica, arial, sans-serif;overflow-x:hidden;margin:0}body section.container{width:790px;margin:40px auto}body section.container h1{color:#DDD;font-size:3em;font-weight:bold;text-align:center;text-shadow:0 1px 0px #000;text-transform:lowercase;margin-bottom:0.2em}body section.container h2{font-size:0.8em;color:#666;text-align:center;margin-bottom:4em;text-shadow:0 1px 0px rgba(0, 0, 0, 0.5)}body section.container div#slider{-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:20px;background:rgba(0, 0, 0, 0.3);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(0, 0, 0, 0.9) inset}body section.container div#slider div.fluxslider div.images{width:100%;border:1px solid rgba(255, 255, 255, 0.1);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box}body section.container div#slider div.fluxslider ul.pagination{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:10px 0 !important;overflow:hidden}body section.container div#slider div.fluxslider ul.pagination li{text-indent:10000px;height:8px;width:8px;-moz-border-radius:10px;-webkit-border-radius:10px;-o-border-radius:10px;-ms-border-radius:10px;-khtml-border-radius:10px;border-radius:10px;background:rgba(0, 0, 0, 0.6);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1)}body section.container div#slider div.fluxslider ul.pagination li.current{background:rgba(255, 255, 255, 0.2)}footer{width:100%;text-align:center;font-size:0.7em;margin-top:4em;color:#666}footer p{margin-bottom:2em}body#transitiongallery section.container{width:960px}body#transitiongallery section.container div#slidercontainer{position:relative}body#transitiongallery section.container div#slidercontainer div#transitions{position:absolute;z-index:50;top:20px;right:20px;width:150px}body#transitiongallery section.container div#slidercontainer div#transitions h2{font-size:1em;text-align:left;color:#CCC;font-weight:bold;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul{margin-bottom:1.5em}body#transitiongallery section.container div#slidercontainer div#transitions ul li{font-size:0.8em;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul li a{display:block;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;padding:0.5em;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #444444), color-stop(100%, #333333));background-image:-webkit-linear-gradient(top, #444444,#333333);background-image:-moz-linear-gradient(top, #444444,#333333);background-image:-o-linear-gradient(top, #444444,#333333);background-image:linear-gradient(top, #444444,#333333);border:1px solid rgba(255, 255, 255, 0.1);-webkit-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-moz-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-o-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;position:relative}body#transitiongallery section.container div#slidercontainer div#transitions ul li a:active{top:1px}body#transitiongallery section.container div#slidercontainer div#transitions ul li a.new:after{content:'New';font-size:0.8em;padding:0.2em 0.4em;color:#FFF;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dd4c10), color-stop(100%, #d23a13));background-image:-webkit-linear-gradient(top, #dd4c10,#d23a13);background-image:-moz-linear-gradient(top, #dd4c10,#d23a13);background-image:-o-linear-gradient(top, #dd4c10,#d23a13);background-image:linear-gradient(top, #dd4c10,#d23a13);border:1px solid #FFF;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;-moz-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);-webkit-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);-o-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);position:absolute;top:-0.5em;right:-0.5em}
View
2  css/style.css
@@ -1 +1 @@
-html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline}body{line-height:1;color:black;background:white}ol,ul{list-style:none}table{border-collapse:separate;border-spacing:0;vertical-align:middle}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:"" ""}q:before,q:after,blockquote:before,blockquote:after{content:""}a img{border:none}section,article,aside,header,footer,nav,dialog,figure{display:block}*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}a{color:#CCC;text-decoration:none}html{background:#2F2F2F}body{background:#2F2F2F;min-height:100%;font-family:helvetica, arial, sans-serif;overflow-x:hidden;margin:0}body section.container{width:790px;margin:40px auto}body section.container h1{color:#DDD;font-size:3em;font-weight:bold;text-align:center;text-shadow:0 1px 0px #000;text-transform:lowercase;margin-bottom:0.2em}body section.container h2{font-size:0.8em;color:#666;text-align:center;margin-bottom:4em;text-shadow:0 1px 0px rgba(0, 0, 0, 0.5)}body section.container div#slider{-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:20px;background:rgba(0, 0, 0, 0.3);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(0, 0, 0, 0.9) inset}body section.container div#slider div.fluxslider div.images{width:100%;border:1px solid rgba(255, 255, 255, 0.1);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box}body section.container div#slider div.fluxslider ul.pagination{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:10px 0 !important;overflow:hidden}body section.container div#slider div.fluxslider ul.pagination li{text-indent:10000px;height:8px;width:8px;-moz-border-radius:10px;-webkit-border-radius:10px;-o-border-radius:10px;-ms-border-radius:10px;-khtml-border-radius:10px;border-radius:10px;background:rgba(0, 0, 0, 0.6);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1)}body section.container div#slider div.fluxslider ul.pagination li.current{background:rgba(255, 255, 255, 0.2)}body section.container footer{width:100%;text-align:center;font-size:0.7em;margin-top:4em;color:#666}body section.container footer p{margin-bottom:2em}body#transitiongallery section.container{width:960px}body#transitiongallery section.container div#slidercontainer{position:relative}body#transitiongallery section.container div#slidercontainer div#transitions{position:absolute;z-index:50;top:20px;right:20px;width:150px}body#transitiongallery section.container div#slidercontainer div#transitions h2{font-size:1em;text-align:left;color:#CCC;font-weight:bold;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul{margin-bottom:1.5em}body#transitiongallery section.container div#slidercontainer div#transitions ul li{font-size:0.8em;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul li a{display:block;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;padding:0.5em;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #444444), color-stop(100%, #333333));background-image:-moz-linear-gradient(top, #444444 0%, #333333 100%);border:1px solid rgba(255, 255, 255, 0.1);-webkit-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-moz-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-o-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;position:relative}body#transitiongallery section.container div#slidercontainer div#transitions ul li a:active{top:1px}body#transitiongallery section.container div#slidercontainer div#transitions ul li a.new:after{content:'New';font-size:0.8em;padding:0.2em 0.4em;color:#FFF;background-image:-webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dd4c10), color-stop(100%, #d23a13));background-image:-moz-linear-gradient(top, #dd4c10 0%, #d23a13 100%);border:1px solid #FFF;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;-moz-box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;-webkit-box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;-o-box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;box-shadow:rgba(0, 0, 0, 0.2) 0px 1px 3px;position:absolute;top:-0.5em;right:-0.5em}section#header{background:#222;padding:10px;overflow:auto}section#header a{color:#CCC;text-decoration:none}section#header a.name{font-family:'Pacifico';font-size:1.1em;margin-right:1em;position:relative;top:3px}section#header a.writeup{font-size:0.8em;border-bottom:1px dashed #CCC}section#header a.writeup:after{content:' \2192'}section#header a.twitter{float:right}section#header div.nav{float:right;font-size:0.7em;padding:0.75em;padding-right:1.5em}section#header div.nav a{margin-left:1.5em}section#header div.nav a:hover{border-bottom:1px dashed #CCC}section#details{text-align:center;padding-top:4em}section#details a{margin-left:1em;padding:1em;background:rgba(255, 255, 255, 0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;color:#000;text-shadow:0 1px 0 rgba(255, 255, 255, 0.2);text-decoration:none;border:1px solid rgba(255, 255, 255, 0.3);font-weight:bold;font-size:0.8em}section#details a:first-child{margin-left:0}section#details a:hover{background:rgba(255, 255, 255, 0.3)}
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}body{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}*{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}a{color:#CCC;text-decoration:none}html{background:#2F2F2F}body{background:#2F2F2F;min-height:100%;font-family:helvetica, arial, sans-serif;overflow-x:hidden;margin:0}body section.container{width:790px;margin:40px auto}body section.container h1{color:#DDD;font-size:3em;font-weight:bold;text-align:center;text-shadow:0 1px 0px #000;text-transform:lowercase;margin-bottom:0.2em}body section.container h2{font-size:0.8em;color:#666;text-align:center;margin-bottom:4em;text-shadow:0 1px 0px rgba(0, 0, 0, 0.5)}body section.container div#slider{-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:20px;background:rgba(0, 0, 0, 0.3);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px rgba(0, 0, 0, 0.9) inset}body section.container div#slider div.fluxslider div.images{width:100%;border:1px solid rgba(255, 255, 255, 0.1);-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box}body section.container div#slider div.fluxslider ul.pagination{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box;padding:10px 0 !important;overflow:hidden}body section.container div#slider div.fluxslider ul.pagination li{text-indent:10000px;height:8px;width:8px;-moz-border-radius:10px;-webkit-border-radius:10px;-o-border-radius:10px;-ms-border-radius:10px;-khtml-border-radius:10px;border-radius:10px;background:rgba(0, 0, 0, 0.6);-webkit-box-shadow:0 1px 0 rgba(255, 255, 255, 0.1)}body section.container div#slider div.fluxslider ul.pagination li.current{background:rgba(255, 255, 255, 0.2)}footer{width:100%;text-align:center;font-size:0.7em;margin-top:4em;color:#666}footer p{margin-bottom:2em}body#transitiongallery section.container{width:960px}body#transitiongallery section.container div#slidercontainer{position:relative}body#transitiongallery section.container div#slidercontainer div#transitions{position:absolute;z-index:50;top:20px;right:20px;width:150px}body#transitiongallery section.container div#slidercontainer div#transitions h2{font-size:1em;text-align:left;color:#CCC;font-weight:bold;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul{margin-bottom:1.5em}body#transitiongallery section.container div#slidercontainer div#transitions ul li{font-size:0.8em;margin-bottom:0.7em}body#transitiongallery section.container div#slidercontainer div#transitions ul li a{display:block;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;padding:0.5em;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #444444), color-stop(100%, #333333));background-image:-webkit-linear-gradient(top, #444444,#333333);background-image:-moz-linear-gradient(top, #444444,#333333);background-image:-o-linear-gradient(top, #444444,#333333);background-image:linear-gradient(top, #444444,#333333);border:1px solid rgba(255, 255, 255, 0.1);-webkit-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-moz-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;-o-box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;box-shadow:0px 1px 0px rgba(0, 0, 0, 0.2) inset;position:relative}body#transitiongallery section.container div#slidercontainer div#transitions ul li a:active{top:1px}body#transitiongallery section.container div#slidercontainer div#transitions ul li a.new:after{content:'New';font-size:0.8em;padding:0.2em 0.4em;color:#FFF;background-image:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dd4c10), color-stop(100%, #d23a13));background-image:-webkit-linear-gradient(top, #dd4c10,#d23a13);background-image:-moz-linear-gradient(top, #dd4c10,#d23a13);background-image:-o-linear-gradient(top, #dd4c10,#d23a13);background-image:linear-gradient(top, #dd4c10,#d23a13);border:1px solid #FFF;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px;-khtml-border-radius:4px;border-radius:4px;-moz-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);-webkit-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);-o-box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);box-shadow:0px 1px 3px rgba(0, 0, 0, 0.2);position:absolute;top:-0.5em;right:-0.5em}section#header{background:#222;padding:10px;overflow:auto}section#header a{color:#CCC;text-decoration:none}section#header a.name{font-family:'Pacifico';font-size:1.1em;margin-right:1em;position:relative;top:3px}section#header a.writeup{font-size:0.8em;border-bottom:1px dashed #CCC}section#header a.writeup:after{content:' \2192'}section#header a.twitter{float:right}section#header div.nav{float:right;font-size:0.7em;padding:0.75em;padding-right:1.5em}section#header div.nav a{margin-left:1.5em}section#header div.nav a:hover{border-bottom:1px dashed #CCC}section#details{text-align:center;padding-top:4em}section#details a{margin-left:1em;padding:1em;background:rgba(255, 255, 255, 0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;color:#000;text-shadow:0 1px 0 rgba(255, 255, 255, 0.2);text-decoration:none;border:1px solid rgba(255, 255, 255, 0.3);font-weight:bold;font-size:0.8em}section#details a:first-child{margin-left:0}section#details a:hover{background:rgba(255, 255, 255, 0.3)}footer div#carbonads-container div.carbonad{background:#353535;margin:6em auto 3em;border:1px solid rgba(255, 255, 255, 0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;text-align:left}
View
42 js/flux.js
@@ -1,5 +1,5 @@
/**
- * @preserve Flux Slider v1.3beta
+ * @preserve Flux Slider v1.3a
* http://www.joelambert.co.uk/flux
*
* Copyright 2011, Joe Lambert. All rights reserved
@@ -9,7 +9,7 @@
// Flux namespace
var flux = {
- version: '1.3beta'
+ version: '1.3a'
};
flux.slider = function(elem, opts) {
@@ -41,6 +41,20 @@ flux.slider = function(elem, opts) {
controls: true
}, opts);
+ // Filter out 3d transitions if the browser doesn't support them
+ if(!flux.browser.supports3d)
+ {
+ var newTrans = [];
+ $(this.options.transitions).each(function(index, tran){
+ var t = new flux.transitions[tran](this);
+
+ if(!t.options.requires3d)
+ newTrans.push(tran);
+ });
+
+ this.options.transitions = newTrans;
+ }
+
// Get a list the images to use
this.images = new Array();
this.imageLoadedCount = 0;
@@ -217,19 +231,19 @@ flux.slider.prototype = {
},
transition: function(transition, opts) {
// Allow a transition to be picked from ALL available transitions (not just the reduced set)
- if(transition == undefined || !flux.transitions[transition])
- {
- // Pick a transition at random from the (possibly reduced set of) transitions
- var index = Math.floor(Math.random()*(this.options.transitions.length));
- transition = this.options.transitions[index];
- }
-
- var tran = new flux.transitions[transition](this, $.extend(this.options[transition] ? this.options[transition] : {}, opts));
+ if(transition == undefined || !flux.transitions[transition])
+ {
+ // Pick a transition at random from the (possibly reduced set of) transitions
+ var index = Math.floor(Math.random()*(this.options.transitions.length));
+ transition = this.options.transitions[index];
+ }
- tran.run();
-
- this.currentImageIndex = this.nextImageIndex;
- this.setNextIndex(this.currentImageIndex+1);
+ var tran = new flux.transitions[transition](this, $.extend(this.options[transition] ? this.options[transition] : {}, opts));
+
+ tran.run();
+
+ this.currentImageIndex = this.nextImageIndex;
+ this.setNextIndex(this.currentImageIndex+1);
},
getImage: function(index) {
index = index % this.images.length;
View
83 js/flux.min.js
@@ -1,52 +1,53 @@
/*
- Flux Slider v1.3beta
+ Flux Slider v1.3a
http://www.joelambert.co.uk/flux
Copyright 2011, Joe Lambert. All rights reserved
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
*/
-var flux={version:"1.3beta"};
-flux.slider=function(b,d){flux.browser.init();if(!flux.browser.supportsTransitions){window.console&&window.console.error&&console.error("Flux Slider requires a browser that supports CSS3 transitions");return false}var a=this;this.element=$(b);this.transitions=[];for(var c in flux.transitions)this.transitions.push(c);this.options=$.extend({autoplay:true,transitions:this.transitions,delay:4E3,pagination:true,controls:true},d);this.images=[];this.currentImageIndex=this.imageLoadedCount=0;this.nextImageIndex=
-1;this.playing=false;this.element.find("img").each(function(e,f){a.images.push(f.cloneNode(false));var g=new Image;g.onload=function(){a.imageLoadedCount++;a.width=this.width;a.height=this.height;if(a.imageLoadedCount>=a.images.length){a.finishedLoading();a.setupImages()}};g.src=f.src;$(f).remove()});this.container=$('<div class="fluxslider"></div>');this.element.append(this.container);this.imageContainer=$('<div class="images loading"></div>').css({position:"relative",overflow:"hidden","min-height":"100px"});
-this.container.append(this.imageContainer);this.image1=$('<div class="image1" style="height: 100%; width: 100%"></div>');this.imageContainer.append(this.image1);this.image2=$('<div class="image2" style="height: 100%; width: 100%"></div>');this.imageContainer.append(this.image2);$(this.image1).css({position:"absolute",top:"0px",left:"0px"});$(this.image2).css({position:"absolute",top:"0px",left:"0px"});this.options.autoplay&&this.start()};
-flux.slider.prototype={constructor:flux.slider,start:function(){var b=this;this.interval=setInterval(function(){b.transition()},this.options.delay)},stop:function(){clearInterval(this.interval);this.interval=null},isPlaying:function(){return this.interval!=null},next:function(b,d){this.showImage(this.currentImageIndex+1,b,d)},prev:function(b,d){this.showImage(this.currentImageIndex-1,b,d)},showImage:function(b,d,a){this.setNextIndex(b);this.stop();this.setupImages();this.transition(d,a);this.options.autoplay&&
-this.start()},finishedLoading:function(){var b=this;this.container.css({width:this.width+"px",height:this.height+"px"});this.imageContainer.removeClass("loading");if(this.options.pagination){this.pagination=$('<ul class="pagination"></ul>').css({margin:"0px",padding:"0px","text-align":"center"});this.pagination.bind("click",function(d){d.preventDefault();b.showImage($(d.target).data("index"))});$(this.images).each(function(d){var a=$('<li data-index="'+d+'">'+(d+1)+"</li>").css({display:"inline-block",
-"margin-left":"0.5em",cursor:"pointer"});b.pagination.append(a);d==0&&a.css("margin-left",0).addClass("current")});this.container.append(this.pagination)}$(this.imageContainer).css({width:this.width+"px",height:this.height+"px"});$(this.image1).css({width:this.width+"px",height:this.height+"px"});$(this.image2).css({width:this.width+"px",height:this.height+"px"});this.container.css({width:this.width+"px",height:this.height+(this.options.pagination?this.pagination.height():0)+"px"})},setupImages:function(){this.image1.css({"background-image":'url("'+
-this.getImage(this.currentImageIndex).src+'")',"z-index":101}).children().remove();this.image2.css({"background-image":'url("'+this.getImage(this.nextImageIndex).src+'")',"z-index":100}).show();if(this.options.pagination){this.pagination.find("li.current").removeClass("current");$(this.pagination.find("li")[this.currentImageIndex]).addClass("current")}},transition:function(b,d){if(b==undefined||!flux.transitions[b])b=this.options.transitions[Math.floor(Math.random()*this.options.transitions.length)];
-(new flux.transitions[b](this,$.extend(this.options[b]?this.options[b]:{},d))).run();this.currentImageIndex=this.nextImageIndex;this.setNextIndex(this.currentImageIndex+1)},getImage:function(b){b%=this.images.length;return this.images[b]},setNextIndex:function(b){if(b==undefined)b=this.currentImageIndex+1;this.nextImageIndex=b;if(this.nextImageIndex>this.images.length-1)this.nextImageIndex=0;if(this.nextImageIndex<0)this.nextImageIndex=this.images.length-1},increment:function(){this.currentImageIndex++;
+var flux={version:"1.3a"};
+flux.slider=function(b,e){flux.browser.init();if(!flux.browser.supportsTransitions){window.console&&window.console.error&&console.error("Flux Slider requires a browser that supports CSS3 transitions");return false}var a=this;this.element=$(b);this.transitions=[];for(var c in flux.transitions)this.transitions.push(c);this.options=$.extend({autoplay:true,transitions:this.transitions,delay:4E3,pagination:true,controls:true},e);if(!flux.browser.supports3d){var d=[];$(this.options.transitions).each(function(f,g){(new flux.transitions[g](this)).options.requires3d||
+d.push(g)});this.options.transitions=d}this.images=[];this.currentImageIndex=this.imageLoadedCount=0;this.nextImageIndex=1;this.playing=false;this.element.find("img").each(function(f,g){a.images.push(g.cloneNode(false));var h=new Image;h.onload=function(){a.imageLoadedCount++;a.width=this.width;a.height=this.height;if(a.imageLoadedCount>=a.images.length){a.finishedLoading();a.setupImages()}};h.src=g.src;$(g).remove()});this.container=$('<div class="fluxslider"></div>');this.element.append(this.container);
+this.imageContainer=$('<div class="images loading"></div>').css({position:"relative",overflow:"hidden","min-height":"100px"});this.container.append(this.imageContainer);this.image1=$('<div class="image1" style="height: 100%; width: 100%"></div>');this.imageContainer.append(this.image1);this.image2=$('<div class="image2" style="height: 100%; width: 100%"></div>');this.imageContainer.append(this.image2);$(this.image1).css({position:"absolute",top:"0px",left:"0px"});$(this.image2).css({position:"absolute",
+top:"0px",left:"0px"});this.options.autoplay&&this.start()};
+flux.slider.prototype={constructor:flux.slider,start:function(){var b=this;this.interval=setInterval(function(){b.transition()},this.options.delay)},stop:function(){clearInterval(this.interval);this.interval=null},isPlaying:function(){return this.interval!=null},next:function(b,e){this.showImage(this.currentImageIndex+1,b,e)},prev:function(b,e){this.showImage(this.currentImageIndex-1,b,e)},showImage:function(b,e,a){this.setNextIndex(b);this.stop();this.setupImages();this.transition(e,a);this.options.autoplay&&
+this.start()},finishedLoading:function(){var b=this;this.container.css({width:this.width+"px",height:this.height+"px"});this.imageContainer.removeClass("loading");if(this.options.pagination){this.pagination=$('<ul class="pagination"></ul>').css({margin:"0px",padding:"0px","text-align":"center"});this.pagination.bind("click",function(e){e.preventDefault();b.showImage($(e.target).data("index"))});$(this.images).each(function(e){var a=$('<li data-index="'+e+'">'+(e+1)+"</li>").css({display:"inline-block",
+"margin-left":"0.5em",cursor:"pointer"});b.pagination.append(a);e==0&&a.css("margin-left",0).addClass("current")});this.container.append(this.pagination)}$(this.imageContainer).css({width:this.width+"px",height:this.height+"px"});$(this.image1).css({width:this.width+"px",height:this.height+"px"});$(this.image2).css({width:this.width+"px",height:this.height+"px"});this.container.css({width:this.width+"px",height:this.height+(this.options.pagination?this.pagination.height():0)+"px"})},setupImages:function(){this.image1.css({"background-image":'url("'+
+this.getImage(this.currentImageIndex).src+'")',"z-index":101}).children().remove();this.image2.css({"background-image":'url("'+this.getImage(this.nextImageIndex).src+'")',"z-index":100}).show();if(this.options.pagination){this.pagination.find("li.current").removeClass("current");$(this.pagination.find("li")[this.currentImageIndex]).addClass("current")}},transition:function(b,e){if(b==undefined||!flux.transitions[b])b=this.options.transitions[Math.floor(Math.random()*this.options.transitions.length)];
+(new flux.transitions[b](this,$.extend(this.options[b]?this.options[b]:{},e))).run();this.currentImageIndex=this.nextImageIndex;this.setNextIndex(this.currentImageIndex+1)},getImage:function(b){b%=this.images.length;return this.images[b]},setNextIndex:function(b){if(b==undefined)b=this.currentImageIndex+1;this.nextImageIndex=b;if(this.nextImageIndex>this.images.length-1)this.nextImageIndex=0;if(this.nextImageIndex<0)this.nextImageIndex=this.images.length-1},increment:function(){this.currentImageIndex++;
if(this.currentImageIndex>this.images.length-1)this.currentImageIndex=0}};
-flux.browser={init:function(){if(flux.browser.supportsTransitions===undefined){var b=document.createElement("div"),d=["-webkit","-moz","-o","-ms"],a=["Webkit","Moz","O","Ms"];if(window.Modernizr&&Modernizr.csstransitions!==undefined)flux.browser.supportsTransitions=Modernizr.csstransitions;else{flux.browser.supportsTransitions=false;for(var c=0;c<a.length;c++)if(a[c]+"Transition"in b.style)flux.browser.supportsTransitions=flux.browser.supportsTransitions||true}if(window.Modernizr&&Modernizr.csstransforms3d!==
-undefined)flux.browser.supports3d=Modernizr.csstransforms3d;else{b=$('<div id="csstransform3d"></div>');d=$('<style media="(transform-3d), ('+d.join("-transform-3d),(")+'-transform-3d)">div#csstransform3d { position: absolute; left: 9px }</style>');$("body").append(b);$("head").append(d);flux.browser.supports3d=b.get(0).offsetLeft==9;b.remove();d.remove()}}},translate:function(b,d,a){b=b!=undefined?b:0;d=d!=undefined?d:0;a=a!=undefined?a:0;return"translate"+(flux.browser.supports3d?"3d(":"(")+b+"px,"+
-d+(flux.browser.supports3d?"px,"+a+"px)":"px)")},rotateX:function(b){return flux.browser.rotate("x",b)},rotateY:function(b){return flux.browser.rotate("y",b)},rotateZ:function(b){return flux.browser.rotate("z",b)},rotate:function(b,d){if(!b in{x:"",y:"",z:""})b="z";d=d!=undefined?d:0;return flux.browser.supports3d?"rotate3d("+(b=="x"?"1":"0")+", "+(b=="y"?"1":"0")+", "+(b=="z"?"1":"0")+", "+d+"deg)":b=="z"?"rotate("+d+"deg)":""}};$(function(){flux.browser.init()});
-(function(){$.fn.css3=function(b){var d={},a=["webkit","moz","ms","o"],c;for(c in b)for(var e=0;e<a.length;e++)d["-"+a[e]+"-"+c]=b[c];this.css(d);return this};$.fn.transitionEnd=function(b){for(var d=["webkitTransitionEnd","transitionend","oTransitionEnd"],a=0;a<d.length;a++)this.bind(d[a],function(c){for(var e=0;e<d.length;e++)$(this).unbind(d[e]);b&&b.call(this,c)});return this}})();
-flux.transition=function(b,d){this.options=$.extend({requires3d:false,after:function(){}},d);this.slider=b;if(this.options.requires3d&&!flux.browser.supports3d){var a=this;this.options.setup=undefined;this.options.after=undefined;this.options.execute=function(){a.finished()}}};
+flux.browser={init:function(){if(flux.browser.supportsTransitions===undefined){var b=document.createElement("div"),e=["-webkit","-moz","-o","-ms"],a=["Webkit","Moz","O","Ms"];if(window.Modernizr&&Modernizr.csstransitions!==undefined)flux.browser.supportsTransitions=Modernizr.csstransitions;else{flux.browser.supportsTransitions=false;for(var c=0;c<a.length;c++)if(a[c]+"Transition"in b.style)flux.browser.supportsTransitions=flux.browser.supportsTransitions||true}if(window.Modernizr&&Modernizr.csstransforms3d!==
+undefined)flux.browser.supports3d=Modernizr.csstransforms3d;else{b=$('<div id="csstransform3d"></div>');e=$('<style media="(transform-3d), ('+e.join("-transform-3d),(")+'-transform-3d)">div#csstransform3d { position: absolute; left: 9px }</style>');$("body").append(b);$("head").append(e);flux.browser.supports3d=b.get(0).offsetLeft==9;b.remove();e.remove()}}},translate:function(b,e,a){b=b!=undefined?b:0;e=e!=undefined?e:0;a=a!=undefined?a:0;return"translate"+(flux.browser.supports3d?"3d(":"(")+b+"px,"+
+e+(flux.browser.supports3d?"px,"+a+"px)":"px)")},rotateX:function(b){return flux.browser.rotate("x",b)},rotateY:function(b){return flux.browser.rotate("y",b)},rotateZ:function(b){return flux.browser.rotate("z",b)},rotate:function(b,e){if(!b in{x:"",y:"",z:""})b="z";e=e!=undefined?e:0;return flux.browser.supports3d?"rotate3d("+(b=="x"?"1":"0")+", "+(b=="y"?"1":"0")+", "+(b=="z"?"1":"0")+", "+e+"deg)":b=="z"?"rotate("+e+"deg)":""}};$(function(){flux.browser.init()});
+(function(){$.fn.css3=function(b){var e={},a=["webkit","moz","ms","o"],c;for(c in b)for(var d=0;d<a.length;d++)e["-"+a[d]+"-"+c]=b[c];this.css(e);return this};$.fn.transitionEnd=function(b){for(var e=["webkitTransitionEnd","transitionend","oTransitionEnd"],a=0;a<e.length;a++)this.bind(e[a],function(c){for(var d=0;d<e.length;d++)$(this).unbind(e[d]);b&&b.call(this,c)});return this}})();
+flux.transition=function(b,e){this.options=$.extend({requires3d:false,after:function(){}},e);this.slider=b;if(this.options.requires3d&&!flux.browser.supports3d){var a=this;this.options.setup=undefined;this.options.after=undefined;this.options.execute=function(){a.finished()}}};
flux.transition.prototype={constructor:flux.transition,run:function(){var b=this;this.options.setup&&this.options.setup.call(this);this.slider.image1.css({"background-image":"none"});this.slider.imageContainer.css("overflow",this.options.requires3d?"visible":"hidden");setTimeout(function(){b.options.execute&&b.options.execute.call(b)},5)},finished:function(){this.options.after&&this.options.after.call(this);this.slider.imageContainer.css("overflow","hidden");this.slider.setupImages();this.slider.element.trigger("fluxTransitionEnd")}};
flux.transitions={};
-flux.transitions.bars=function(b,d){return new flux.transition(b,$.extend({barWidth:60,setup:function(){for(var a=Math.floor(this.slider.image1.width()/this.options.barWidth)+1,c=document.createDocumentFragment(),e=0;e<a;e++){var f=$("<div></div>").attr("class","bar bar-"+e).css({width:this.options.barWidth+"px",height:"100%",position:"absolute",top:"0",left:e*this.options.barWidth+"px","background-image":this.slider.image1.css("background-image"),"background-position":"-"+e*this.options.barWidth+"px 0px"}).css3({"transition-duration":"400ms",
-"transition-timing-function":"ease-in","transition-property":"all","transition-delay":e*40+"ms"});c.appendChild(f.get(0))}this.slider.image1.get(0).appendChild(c)},execute:function(){var a=this,c=this.slider.image1.height(),e=this.slider.image1.find("div.bar");$(e[e.length-1]).transitionEnd(function(){a.finished()});e.css({opacity:"0.5"}).css3({transform:flux.browser.translate(0,c)})}},d))};
-flux.transitions.bars3d=function(b,d){return new flux.transition(b,$.extend({requires3d:true,barWidth:100,perspective:600,setup:function(){var a=Math.floor(this.slider.image1.width()/this.options.barWidth)+1;this.options.barWidth=Math.floor(this.slider.image1.width()/a);for(var c=this.slider.image1.width()-a*this.options.barWidth,e=Math.ceil(c/a),f=this.slider.image1.height(),g=0,j=document.createDocumentFragment(),h=0;h<a;h++){var k=this.options.barWidth;if(c>0){var i=c>=e?e:c;k+=i;c-=i}i=$('<div class="bar bar-'+
-h+'"></div>').css({width:k+"px",height:"100%",position:"absolute",top:"0px",left:"0px","z-index":200,"background-image":this.slider.image1.css("background-image"),"background-position":"-"+g+"px 0px","background-repeat":"no-repeat"}).css3({"backface-visibility":"hidden"});var m=$(i.get(0).cloneNode(false)).css({"background-image":this.slider.image2.css("background-image")}).css3({transform:flux.browser.rotateX(90)+" "+flux.browser.translate(0,-f/2,f/2)}),o=$('<div class="side bar bar-'+h+'"></div>').css({width:f+
-"px",height:f+"px",position:"absolute",top:"0px",left:"0px",background:"#222","z-index":190}).css3({transform:flux.browser.rotateY(90)+" "+flux.browser.translate(f/2,0,-f/2)+" "+flux.browser.rotateY(180),"backface-visibility":"hidden"}),l=$(o.get(0).cloneNode(false)).css3({transform:flux.browser.rotateY(90)+" "+flux.browser.translate(f/2,0,k-f/2)});i=$('<div class="barcontainer"></div>').css({width:k+"px",height:"100%",position:"absolute",top:"0px",left:g+"px","z-index":h>a/2?1E3-h:1E3}).css3({"transition-duration":"800ms",
-"transition-timing-function":"linear","transition-property":"all","transition-delay":h*150+"ms","transform-style":"preserve-3d"}).append(i).append(m).append(o).append(l);j.appendChild(i.get(0));g+=k}this.slider.image1.get(0).appendChild(j);this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"})},execute:function(){var a=this,c=this.slider.image1.height(),e=this.slider.image1.find("div.barcontainer");this.slider.image2.hide();e.last().transitionEnd(function(){a.slider.image2.show();
-a.finished()});e.css3({transform:flux.browser.rotateX(-90)+" "+flux.browser.translate(0,c/2,c/2)})}},d))};flux.transitions.blinds=function(b,d){return new flux.transitions.bars(b,$.extend({barWidth:70,execute:function(){var a=this;this.slider.image1.height();var c=this.slider.image1.find("div.bar");$(c[c.length-1]).transitionEnd(function(){a.finished()});c.css({opacity:"0.5"}).css3({transform:"scalex(0.0001)"})}},d))};
-flux.transitions.blinds3d=function(b,d){return new flux.transition(b,$.extend({requires3d:true,barWidth:150,perspective:600,setup:function(){var a=Math.floor(this.slider.image1.width()/this.options.barWidth)+1;this.slider.image1.height();this.options.barWidth=Math.floor(this.slider.image1.width()/a);for(var c=this.slider.image1.width()-a*this.options.barWidth,e=Math.ceil(c/a),f=this.slider.image1.height(),g=0,j=document.createDocumentFragment(),h=0;h<a;h++){var k,i,m;if(c>0){k=c>=e?e:remainderY;c-=
-k}k=this.options.barWidth;i=$('<div class="bar bar-'+h+'"></div>').css({width:k+"px",height:"100%",position:"absolute",top:"0px",left:"0px","z-index":200,"background-image":this.slider.image1.css("background-image"),"background-position":"-"+g+"px 0px","background-repeat":"no-repeat"}).css3({"backface-visibility":"hidden"});m=$(i.get(0).cloneNode(false)).css({"background-image":this.slider.image2.css("background-image"),"z-index":190}).css3({transform:flux.browser.rotateY(180)});i=$('<div class="barcontainer"></div>').css({width:k+
-"px",height:f+"px",position:"absolute",top:"0px",left:g+"px","z-index":h>a/2?1E3-h:1E3}).css3({"transition-duration":"800ms","transition-timing-function":"ease-out","transition-property":"all","transition-delay":h*150+"ms","transform-style":"preserve-3d"}).append(i).append(m);j.appendChild(i.get(0));g+=k}this.slider.image1.get(0).appendChild(j);this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"})},execute:function(){var a=this,c=this.slider.image1.find("div.barcontainer");
-this.slider.image2.hide();c.last().transitionEnd(function(){a.slider.image2.show();a.finished()});c.css3({transform:flux.browser.rotateY(180)})}},d))};
-flux.transitions.zip=function(b,d){return new flux.transitions.bars(b,$.extend({execute:function(){var a=this,c=this.slider.image1.height(),e=this.slider.image1.find("div.bar");$(e[e.length-1]).transitionEnd(function(){a.finished()});e.each(function(f,g){setTimeout(function(){$(g).css({opacity:"0.3"}).css3({transform:flux.browser.translate(0,f%2?"-"+2*c:c)})},5)})}},d))};
-flux.transitions.blocks=function(b,d){return new flux.transition(b,$.extend({blockSize:80,blockDelays:{},maxDelay:0,setup:function(){for(var a=Math.floor(this.slider.image1.width()/this.options.blockSize)+1,c=Math.floor(this.slider.image1.height()/this.options.blockSize)+1,e=document.createDocumentFragment(),f=0;f<a;f++)for(var g=0;g<c;g++){var j=Math.floor(Math.random()*10*100),h=$("<div></div>").attr("class","block block-"+f+"-"+g).data("id",f+":"+g).css({width:this.options.blockSize+"px",height:this.options.blockSize+
-"px",position:"absolute",top:g*this.options.blockSize+"px",left:f*this.options.blockSize+"px","background-image":this.slider.image1.css("background-image"),"background-position":"-"+f*this.options.blockSize+"px -"+g*this.options.blockSize+"px"}).css3({"transition-duration":"350ms","transition-timing-function":"ease-in","transition-property":"all","transition-delay":j+"ms"});e.appendChild(h.get(0));if(j>this.options.maxDelay){this.options.maxDelayBlock=h;this.options.maxDelay=j}}this.slider.image1.get(0).appendChild(e)},
-execute:function(){var a=this,c=this.slider.image1.find("div.block");this.options.maxDelayBlock.transitionEnd(function(){a.finished()});c.each(function(e,f){setTimeout(function(){$(f).css({opacity:"0"}).css3({transform:"scale(0.8)"})},5)})}},d))};
-flux.transitions.concentric=function(b,d){return new flux.transition(b,$.extend({blockSize:60,delay:150,alternate:false,setup:function(){for(var a=this.slider.image1.width(),c=this.slider.image1.height(),e=Math.ceil((Math.sqrt(a*a+c*c)-this.options.blockSize)/2/this.options.blockSize)+1,f=document.createDocumentFragment(),g=0;g<e;g++){var j=2*g*this.options.blockSize+this.options.blockSize;j=$("<div></div>").attr("class","block block-"+g).css({width:j+"px",height:j+"px",position:"absolute",top:(c-
-j)/2+"px",left:(a-j)/2+"px","z-index":100+(e-g),"background-image":this.slider.image1.css("background-image"),"background-position":"center center"}).css3({"border-radius":"1000px","transition-duration":"800ms","transition-timing-function":"linear","transition-property":"all","transition-delay":(e-g)*this.options.delay+"ms"});f.appendChild(j.get(0))}this.slider.image1.get(0).appendChild(f)},execute:function(){var a=this,c=this.slider.image1.find("div.block");$(c[0]).transitionEnd(function(){a.finished()});
-c.each(function(e,f){setTimeout(function(){$(f).css({opacity:"0"}).css3({transform:flux.browser.rotateZ((!a.options.alternate||e%2?"":"-")+"90")})},5)})}},d))};flux.transitions.warp=function(b,d){return new flux.transitions.concentric(b,$.extend({delay:30,alternate:true},d))};
-flux.transitions.cube=function(b,d){return new flux.transition(b,$.extend({requires3d:true,barWidth:100,direction:"left",perspective:1E3,setup:function(){var a=this.slider.image1.width(),c=this.slider.image1.height();this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"});this.cubeContainer=$('<div class="cube"></div>').css({width:a+"px",height:c+"px",position:"relative"}).css3({"transition-duration":"800ms","transition-timing-function":"linear","transition-property":"all",
+flux.transitions.bars=function(b,e){return new flux.transition(b,$.extend({barWidth:60,setup:function(){for(var a=Math.floor(this.slider.image1.width()/this.options.barWidth)+1,c=document.createDocumentFragment(),d=0;d<a;d++){var f=$("<div></div>").attr("class","bar bar-"+d).css({width:this.options.barWidth+"px",height:"100%",position:"absolute",top:"0",left:d*this.options.barWidth+"px","background-image":this.slider.image1.css("background-image"),"background-position":"-"+d*this.options.barWidth+"px 0px"}).css3({"transition-duration":"400ms",
+"transition-timing-function":"ease-in","transition-property":"all","transition-delay":d*40+"ms"});c.appendChild(f.get(0))}this.slider.image1.get(0).appendChild(c)},execute:function(){var a=this,c=this.slider.image1.height(),d=this.slider.image1.find("div.bar");$(d[d.length-1]).transitionEnd(function(){a.finished()});d.css({opacity:"0.5"}).css3({transform:flux.browser.translate(0,c)})}},e))};
+flux.transitions.bars3d=function(b,e){return new flux.transition(b,$.extend({requires3d:true,barWidth:100,perspective:600,setup:function(){var a=Math.floor(this.slider.image1.width()/this.options.barWidth)+1;this.options.barWidth=Math.floor(this.slider.image1.width()/a);for(var c=this.slider.image1.width()-a*this.options.barWidth,d=Math.ceil(c/a),f=this.slider.image1.height(),g=0,h=document.createDocumentFragment(),i=0;i<a;i++){var k=this.options.barWidth;if(c>0){var j=c>=d?d:c;k+=j;c-=j}j=$('<div class="bar bar-'+
+i+'"></div>').css({width:k+"px",height:"100%",position:"absolute",top:"0px",left:"0px","z-index":200,"background-image":this.slider.image1.css("background-image"),"background-position":"-"+g+"px 0px","background-repeat":"no-repeat"}).css3({"backface-visibility":"hidden"});var m=$(j.get(0).cloneNode(false)).css({"background-image":this.slider.image2.css("background-image")}).css3({transform:flux.browser.rotateX(90)+" "+flux.browser.translate(0,-f/2,f/2)}),o=$('<div class="side bar bar-'+i+'"></div>').css({width:f+
+"px",height:f+"px",position:"absolute",top:"0px",left:"0px",background:"#222","z-index":190}).css3({transform:flux.browser.rotateY(90)+" "+flux.browser.translate(f/2,0,-f/2)+" "+flux.browser.rotateY(180),"backface-visibility":"hidden"}),l=$(o.get(0).cloneNode(false)).css3({transform:flux.browser.rotateY(90)+" "+flux.browser.translate(f/2,0,k-f/2)});j=$('<div class="barcontainer"></div>').css({width:k+"px",height:"100%",position:"absolute",top:"0px",left:g+"px","z-index":i>a/2?1E3-i:1E3}).css3({"transition-duration":"800ms",
+"transition-timing-function":"linear","transition-property":"all","transition-delay":i*150+"ms","transform-style":"preserve-3d"}).append(j).append(m).append(o).append(l);h.appendChild(j.get(0));g+=k}this.slider.image1.get(0).appendChild(h);this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"})},execute:function(){var a=this,c=this.slider.image1.height(),d=this.slider.image1.find("div.barcontainer");this.slider.image2.hide();d.last().transitionEnd(function(){a.slider.image2.show();
+a.finished()});d.css3({transform:flux.browser.rotateX(-90)+" "+flux.browser.translate(0,c/2,c/2)})}},e))};flux.transitions.blinds=function(b,e){return new flux.transitions.bars(b,$.extend({barWidth:70,execute:function(){var a=this;this.slider.image1.height();var c=this.slider.image1.find("div.bar");$(c[c.length-1]).transitionEnd(function(){a.finished()});c.css({opacity:"0.5"}).css3({transform:"scalex(0.0001)"})}},e))};
+flux.transitions.blinds3d=function(b,e){return new flux.transition(b,$.extend({requires3d:true,barWidth:150,perspective:600,setup:function(){var a=Math.floor(this.slider.image1.width()/this.options.barWidth)+1;this.slider.image1.height();this.options.barWidth=Math.floor(this.slider.image1.width()/a);for(var c=this.slider.image1.width()-a*this.options.barWidth,d=Math.ceil(c/a),f=this.slider.image1.height(),g=0,h=document.createDocumentFragment(),i=0;i<a;i++){var k,j,m;if(c>0){k=c>=d?d:remainderY;c-=
+k}k=this.options.barWidth;j=$('<div class="bar bar-'+i+'"></div>').css({width:k+"px",height:"100%",position:"absolute",top:"0px",left:"0px","z-index":200,"background-image":this.slider.image1.css("background-image"),"background-position":"-"+g+"px 0px","background-repeat":"no-repeat"}).css3({"backface-visibility":"hidden"});m=$(j.get(0).cloneNode(false)).css({"background-image":this.slider.image2.css("background-image"),"z-index":190}).css3({transform:flux.browser.rotateY(180)});j=$('<div class="barcontainer"></div>').css({width:k+
+"px",height:f+"px",position:"absolute",top:"0px",left:g+"px","z-index":i>a/2?1E3-i:1E3}).css3({"transition-duration":"800ms","transition-timing-function":"ease-out","transition-property":"all","transition-delay":i*150+"ms","transform-style":"preserve-3d"}).append(j).append(m);h.appendChild(j.get(0));g+=k}this.slider.image1.get(0).appendChild(h);this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"})},execute:function(){var a=this,c=this.slider.image1.find("div.barcontainer");
+this.slider.image2.hide();c.last().transitionEnd(function(){a.slider.image2.show();a.finished()});c.css3({transform:flux.browser.rotateY(180)})}},e))};
+flux.transitions.zip=function(b,e){return new flux.transitions.bars(b,$.extend({execute:function(){var a=this,c=this.slider.image1.height(),d=this.slider.image1.find("div.bar");$(d[d.length-1]).transitionEnd(function(){a.finished()});d.each(function(f,g){setTimeout(function(){$(g).css({opacity:"0.3"}).css3({transform:flux.browser.translate(0,f%2?"-"+2*c:c)})},5)})}},e))};
+flux.transitions.blocks=function(b,e){return new flux.transition(b,$.extend({blockSize:80,blockDelays:{},maxDelay:0,setup:function(){for(var a=Math.floor(this.slider.image1.width()/this.options.blockSize)+1,c=Math.floor(this.slider.image1.height()/this.options.blockSize)+1,d=document.createDocumentFragment(),f=0;f<a;f++)for(var g=0;g<c;g++){var h=Math.floor(Math.random()*10*100),i=$("<div></div>").attr("class","block block-"+f+"-"+g).data("id",f+":"+g).css({width:this.options.blockSize+"px",height:this.options.blockSize+
+"px",position:"absolute",top:g*this.options.blockSize+"px",left:f*this.options.blockSize+"px","background-image":this.slider.image1.css("background-image"),"background-position":"-"+f*this.options.blockSize+"px -"+g*this.options.blockSize+"px"}).css3({"transition-duration":"350ms","transition-timing-function":"ease-in","transition-property":"all","transition-delay":h+"ms"});d.appendChild(i.get(0));if(h>this.options.maxDelay){this.options.maxDelayBlock=i;this.options.maxDelay=h}}this.slider.image1.get(0).appendChild(d)},
+execute:function(){var a=this,c=this.slider.image1.find("div.block");this.options.maxDelayBlock.transitionEnd(function(){a.finished()});c.each(function(d,f){setTimeout(function(){$(f).css({opacity:"0"}).css3({transform:"scale(0.8)"})},5)})}},e))};
+flux.transitions.concentric=function(b,e){return new flux.transition(b,$.extend({blockSize:60,delay:150,alternate:false,setup:function(){for(var a=this.slider.image1.width(),c=this.slider.image1.height(),d=Math.ceil((Math.sqrt(a*a+c*c)-this.options.blockSize)/2/this.options.blockSize)+1,f=document.createDocumentFragment(),g=0;g<d;g++){var h=2*g*this.options.blockSize+this.options.blockSize;h=$("<div></div>").attr("class","block block-"+g).css({width:h+"px",height:h+"px",position:"absolute",top:(c-
+h)/2+"px",left:(a-h)/2+"px","z-index":100+(d-g),"background-image":this.slider.image1.css("background-image"),"background-position":"center center"}).css3({"border-radius":"1000px","transition-duration":"800ms","transition-timing-function":"linear","transition-property":"all","transition-delay":(d-g)*this.options.delay+"ms"});f.appendChild(h.get(0))}this.slider.image1.get(0).appendChild(f)},execute:function(){var a=this,c=this.slider.image1.find("div.block");$(c[0]).transitionEnd(function(){a.finished()});
+c.each(function(d,f){setTimeout(function(){$(f).css({opacity:"0"}).css3({transform:flux.browser.rotateZ((!a.options.alternate||d%2?"":"-")+"90")})},5)})}},e))};flux.transitions.warp=function(b,e){return new flux.transitions.concentric(b,$.extend({delay:30,alternate:true},e))};
+flux.transitions.cube=function(b,e){return new flux.transition(b,$.extend({requires3d:true,barWidth:100,direction:"left",perspective:1E3,setup:function(){var a=this.slider.image1.width(),c=this.slider.image1.height();this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"});this.cubeContainer=$('<div class="cube"></div>').css({width:a+"px",height:c+"px",position:"relative"}).css3({"transition-duration":"800ms","transition-timing-function":"linear","transition-property":"all",
"transform-style":"preserve-3d"});a={height:"100%",width:"100%",position:"absolute",top:"0px",left:"0px"};this.cubeContainer.append($('<div class="face current"></div>').css($.extend(a,{background:this.slider.image1.css("background-image")})));this.cubeContainer.append($('<div class="face next"></div>').css($.extend(a,{background:this.slider.image2.css("background-image")})).css3({transform:this.options.transitionStrings.call(this,this.options.direction,"nextFace")}));this.slider.image1.append(this.cubeContainer)},
-execute:function(){var a=this;this.slider.image1.width();this.slider.image1.height();this.slider.image2.hide();this.cubeContainer.css3({transform:this.options.transitionStrings.call(this,this.options.direction,"container")}).transitionEnd(function(){a.slider.image2.show();a.finished()})},transitionStrings:function(a,c){var e=this.slider.image1.width(),f=this.slider.image1.height();e={up:{nextFace:flux.browser.rotateX(-90)+" "+flux.browser.translate(0,f/2,f/2),container:flux.browser.rotateX(90)+" "+
-flux.browser.translate(0,-f/2,f/2)},down:{nextFace:flux.browser.rotateX(90)+" "+flux.browser.translate(0,-f/2,f/2),container:flux.browser.rotateX(-90)+" "+flux.browser.translate(0,f/2,f/2)},left:{nextFace:flux.browser.rotateY(90)+" "+flux.browser.translate(e/2,0,e/2),container:flux.browser.rotateY(-90)+" "+flux.browser.translate(-e/2,0,e/2)},right:{nextFace:flux.browser.rotateY(-90)+" "+flux.browser.translate(-e/2,0,e/2),container:flux.browser.rotateY(90)+" "+flux.browser.translate(e/2,0,e/2)}};return e[a]&&
-e[a][c]?e[a][c]:false}},d))};
-flux.transitions.tiles3d=function(b,d){return new flux.transition(b,$.extend({requires3d:true,tileWidth:180,perspective:600,setup:function(){var a=Math.floor(this.slider.image1.width()/this.options.tileWidth)+1,c=Math.floor(this.slider.image1.height()/this.options.tileWidth)+1;this.options.tileWidth=Math.floor(this.slider.image1.width()/a);var e=this.slider.image1.width()-a*this.options.tileWidth,f=Math.ceil(e/a),g=this.slider.image1.height()-c*this.options.tileWidth,j=Math.ceil(g/c);this.slider.image1.height();
-for(var h=0,k=document.createDocumentFragment(),i=0;i<a;i++){var m=0,o=this.options.tileWidth;if(e>0){var l=e>=f?f:e;o+=l;e-=l}for(l=0;l<c;l++){var p=this.options.tileWidth,n=g;if(n>0)p+=n>=j?j:n;n=$('<div class="tile tile-'+i+"-"+l+'"></div>').css({width:o+"px",height:p+"px",position:"absolute",top:"0px",left:"0px","z-index":200,"background-image":this.slider.image1.css("background-image"),"background-position":"-"+h+"px -"+m+"px","background-repeat":"no-repeat"}).css3({"backface-visibility":"hidden"});
-var q=$(n.get(0).cloneNode(false)).css({"background-image":this.slider.image2.css("background-image"),"z-index":190}).css3({transform:flux.browser.rotateY(180)});n=$('<div class="tilecontainer"></div>').css({width:o+"px",height:p+"px",position:"absolute",top:m+"px",left:h+"px","z-index":(i>a/2?500-i:500)+(l>c/2?500-l:500)}).css3({"transition-duration":"800ms","transition-timing-function":"ease-out","transition-property":"all","transition-delay":i*200+l*150+"ms","transform-style":"preserve-3d"}).append(n).append(q);
-k.appendChild(n.get(0));m+=p}h+=o}this.slider.image1.get(0).appendChild(k);this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"})},execute:function(){var a=this,c=this.slider.image1.find("div.tilecontainer");this.slider.image2.hide();c.last().transitionEnd(function(){a.slider.image2.show();a.finished()});c.css3({transform:flux.browser.rotateY(180)})}},d))};
+execute:function(){var a=this;this.slider.image1.width();this.slider.image1.height();this.slider.image2.hide();this.cubeContainer.css3({transform:this.options.transitionStrings.call(this,this.options.direction,"container")}).transitionEnd(function(){a.slider.image2.show();a.finished()})},transitionStrings:function(a,c){var d=this.slider.image1.width(),f=this.slider.image1.height();d={up:{nextFace:flux.browser.rotateX(-90)+" "+flux.browser.translate(0,f/2,f/2),container:flux.browser.rotateX(90)+" "+
+flux.browser.translate(0,-f/2,f/2)},down:{nextFace:flux.browser.rotateX(90)+" "+flux.browser.translate(0,-f/2,f/2),container:flux.browser.rotateX(-90)+" "+flux.browser.translate(0,f/2,f/2)},left:{nextFace:flux.browser.rotateY(90)+" "+flux.browser.translate(d/2,0,d/2),container:flux.browser.rotateY(-90)+" "+flux.browser.translate(-d/2,0,d/2)},right:{nextFace:flux.browser.rotateY(-90)+" "+flux.browser.translate(-d/2,0,d/2),container:flux.browser.rotateY(90)+" "+flux.browser.translate(d/2,0,d/2)}};return d[a]&&
+d[a][c]?d[a][c]:false}},e))};
+flux.transitions.tiles3d=function(b,e){return new flux.transition(b,$.extend({requires3d:true,tileWidth:180,perspective:600,setup:function(){var a=Math.floor(this.slider.image1.width()/this.options.tileWidth)+1,c=Math.floor(this.slider.image1.height()/this.options.tileWidth)+1;this.options.tileWidth=Math.floor(this.slider.image1.width()/a);var d=this.slider.image1.width()-a*this.options.tileWidth,f=Math.ceil(d/a),g=this.slider.image1.height()-c*this.options.tileWidth,h=Math.ceil(g/c);this.slider.image1.height();
+for(var i=0,k=document.createDocumentFragment(),j=0;j<a;j++){var m=0,o=this.options.tileWidth;if(d>0){var l=d>=f?f:d;o+=l;d-=l}for(l=0;l<c;l++){var p=this.options.tileWidth,n=g;if(n>0)p+=n>=h?h:n;n=$('<div class="tile tile-'+j+"-"+l+'"></div>').css({width:o+"px",height:p+"px",position:"absolute",top:"0px",left:"0px","z-index":200,"background-image":this.slider.image1.css("background-image"),"background-position":"-"+i+"px -"+m+"px","background-repeat":"no-repeat"}).css3({"backface-visibility":"hidden"});
+var q=$(n.get(0).cloneNode(false)).css({"background-image":this.slider.image2.css("background-image"),"z-index":190}).css3({transform:flux.browser.rotateY(180)});n=$('<div class="tilecontainer"></div>').css({width:o+"px",height:p+"px",position:"absolute",top:m+"px",left:i+"px","z-index":(j>a/2?500-j:500)+(l>c/2?500-l:500)}).css3({"transition-duration":"800ms","transition-timing-function":"ease-out","transition-property":"all","transition-delay":j*200+l*150+"ms","transform-style":"preserve-3d"}).append(n).append(q);
+k.appendChild(n.get(0));m+=p}i+=o}this.slider.image1.get(0).appendChild(k);this.slider.imageContainer.css3({perspective:this.options.perspective,"perspective-origin":"50% 50%"})},execute:function(){var a=this,c=this.slider.image1.find("div.tilecontainer");this.slider.image2.hide();c.last().transitionEnd(function(){a.slider.image2.show();a.finished()});c.css3({transform:flux.browser.rotateY(180)})}},e))};
View
38 js/src/flux.slider.js
@@ -41,6 +41,20 @@ flux.slider = function(elem, opts) {
controls: true
}, opts);
+ // Filter out 3d transitions if the browser doesn't support them
+ if(!flux.browser.supports3d)
+ {
+ var newTrans = [];
+ $(this.options.transitions).each(function(index, tran){
+ var t = new flux.transitions[tran](this);
+
+ if(!t.options.requires3d)
+ newTrans.push(tran);
+ });
+
+ this.options.transitions = newTrans;
+ }
+
// Get a list the images to use
this.images = new Array();
this.imageLoadedCount = 0;
@@ -217,19 +231,19 @@ flux.slider.prototype = {
},
transition: function(transition, opts) {
// Allow a transition to be picked from ALL available transitions (not just the reduced set)
- if(transition == undefined || !flux.transitions[transition])
- {
- // Pick a transition at random from the (possibly reduced set of) transitions
- var index = Math.floor(Math.random()*(this.options.transitions.length));
- transition = this.options.transitions[index];
- }
-
- var tran = new flux.transitions[transition](this, $.extend(this.options[transition] ? this.options[transition] : {}, opts));
+ if(transition == undefined || !flux.transitions[transition])
+ {
+ // Pick a transition at random from the (possibly reduced set of) transitions
+ var index = Math.floor(Math.random()*(this.options.transitions.length));
+ transition = this.options.transitions[index];
+ }
- tran.run();
-
- this.currentImageIndex = this.nextImageIndex;
- this.setNextIndex(this.currentImageIndex+1);
+ var tran = new flux.transitions[transition](this, $.extend(this.options[transition] ? this.options[transition] : {}, opts));
+
+ tran.run();
+
+ this.currentImageIndex = this.nextImageIndex;
+ this.setNextIndex(this.currentImageIndex+1);
},
getImage: function(index) {
index = index % this.images.length;
Please sign in to comment.
Something went wrong with that request. Please try again.