Moving Boxes
HTML
<p> Resize this panel/window and see what happens </p>
<div id="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
CSS
.item{
width:100px;height:100px;
margin:5px;
background:red;}
#container{
border:1px solid black;
width:80%;
}
.isotope,
.isotope .isotope-item {
-webkit-transition-duration: 0.8s;
-moz-transition-duration: 0.8s;
-ms-transition-duration: 0.8s;
-o-transition-duration: 0.8s;
transition-duration: 0.8s;
}
.isotope {
-webkit-transition-property: height, width;
-moz-transition-property: height, width;
-ms-transition-property: height, width;
-o-transition-property: height, width;
transition-property: height, width;
}
.isotope .isotope-item {
-webkit-transition-property: -webkit-transform, opacity;
-moz-transition-property: -moz-transform, opacity;
-ms-transition-property: -ms-transform, opacity;
-o-transition-property: top, left, opacity;
transition-property: transform, opacity;
}
/**** disabling Isotope CSS3 transitions ****/
.isotope.no-transition,
.isotope.no-transition .isotope-item,
.isotope .isotope-item.no-transition {
-webkit-transition-duration: 0s;
-moz-transition-duration: 0s;
-ms-transition-duration: 0s;
-o-transition-duration: 0s;
transition-duration: 0s;
}
JavaScript
(function (a, b, c) {
"use strict";
var d = a.document,
e = a.Modernizr,
f = function (a) {
return a.charAt(0).toUpperCase() + a.slice(1)
}, g = "Moz Webkit O Ms".split(" "),
h = function (a) {
var b = d.documentElement.style,
c;
if (typeof b[a] == "string") return a;
a = f(a);
for (var e = 0, h = g.length; e < h; e++) {
c = g[e] + a;
if (typeof b[c] == "string") return c
}
}, i = h("transform"),
j = h("transitionProperty"),
k = {
csstransforms: function () {
return !!i
},
csstransforms3d: function () {
var a = !! h("perspective");
if (a) {
var c = " -o- -moz- -ms- -webkit- -khtml- ".split(" "),
d = "@media (" + c.join("transform-3d),(") + "modernizr)",
e = b("<style>" + d + "{#modernizr{height:3px}}" + "</style>").appendTo("head"),
f = b('<div id="modernizr" />').appendTo("html");
a = f.height() === 3, f.remove(), e.remove()
}
return a
},
csstransitions: function () {
return !!j
}
}, l;
if (e)
for (l in k) e.hasOwnProperty(l) || e.addTest(l, k[l]);
else {
e = a.Modernizr = {
_version: "1.6ish: miniModernizr for Isotope"
};
var m = " ",
n;
for (l in k) n = k[l](), e[l] = n, m += " " + (n ? "" : "no-") + l;
b("html").addClass(m)
} if (e.csstransforms) {
var o = e.csstransforms3d ? {
translate: function (a) {
return "translate3d(" + a[0] + "px, " + a[1] + "px, 0) "
},
scale: function (a) {
return "scale3d(" + a + ", " + a + ", 1) "
...