(
function
() {
var
$window = $(window),
flexslider;
function
getGridSize() {
return
(window.innerWidth < 600) ? 2 :
(window.innerWidth < 900) ? 3 : 4;
}
$(
function
() {
SyntaxHighlighter.all();
});
$window.load(
function
() {
$(
'.flexslider'
).flexslider({
animation:
"slide"
,
animationLoop:
false
,
itemWidth: 210,
itemMargin: 5,
minItems: getGridSize(),
maxItems: getGridSize()
});
});
$window.resize(
function
() {
var
gridSize = getGridSize();
flexslider.vars.minItems = gridSize;
flexslider.vars.maxItems = gridSize;
});
}());