Browse Source

Merge branch 'master' of github.com:desandro/isotope

pull/96/head
David DeSandro 14 years ago
parent
commit
f3622eb84b
  1. 4
      _includes/element-partial.html
  2. 10
      _includes/random-sizes.js
  3. 2
      _layouts/elements.html
  4. 2
      _posts/demos/2010-12-29-layout-modes.html
  5. 2
      _posts/demos/2010-12-31-relayout.html
  6. 2
      _posts/tests/2011-04-26-item-position-data01.html
  7. 2
      _posts/tests/2011-05-13-jquery-animation01.html
  8. 76
      _posts/tests/2011-05-18-centered-masonry.html

4
_includes/element-partial.html

@ -1,6 +1,4 @@
{% capture a %}{{ element.number | modulus:7 | modulus:2 }}{% endcapture %}
{% capture b %}{{ element.number | modulus:3 }}{% endcapture %}
{% capture classnames %}{% for cat in element.categories %}{{ cat }} {% endfor %} {% if page.infinite_scroll %} width2 height2 {% else %} {% if a == '1' %} width2 {% endif %} {% if b == '0' %} height2 {% endif %} {% endif %} {% endcapture %}
{% capture classnames %}{% for cat in element.categories %}{{ cat }} {% endfor %} {% if page.infinite_scroll %} width2 height2 {% endif %} {% endcapture %}
<div class="element {{ classnames }}" data-symbol="{{ element.symbol }}" data-category="{{ element.categories[0] }}">
<p class="number">{{ element.number }}</p>
<h3 class="symbol">{{ element.symbol }}</h3>

10
_includes/random-sizes.js

@ -0,0 +1,10 @@
// hacky way of adding random size classes
$container.find('.element').each(function(){
if ( Math.random() > 0.6 ) {
$(this).addClass('width2');
}
if ( Math.random() > 0.6 ) {
$(this).addClass('height2');
}
});

2
_layouts/elements.html

@ -57,6 +57,8 @@
$(function(){
var $container = $('#container');
{% include random-sizes.js %}
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class

2
_posts/demos/2010-12-29-layout-modes.html

@ -28,6 +28,8 @@ related: layouts
$(function(){
var $container = $('#container');
{% include random-sizes.js %}
{% include layout-change.js %}

2
_posts/demos/2010-12-31-relayout.html

@ -28,6 +28,8 @@ related: methods
$(function(){
var $container = $('#container');
{% include random-sizes.js %}
// toggle variable sizes of all elements
$('#toggle-sizes a').click(function(){

2
_posts/tests/2011-04-26-item-position-data01.html

@ -34,6 +34,8 @@ category: tests
var $container = $('#container');
{% include random-sizes.js %}
{% include sort-buttons.js %}
// toggle variable sizes of all elements

2
_posts/tests/2011-05-13-jquery-animation01.html

@ -61,6 +61,8 @@ category: tests
var $container = $('#container');
{% include random-sizes.js %}
{% include sort-buttons.js %}
$('#filters').find('a').click(function(){

76
_posts/tests/2011-05-18-centered-masonry.html

@ -119,44 +119,12 @@ category: tests
};
var $container = $('#container');
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
return false;
});
{% include sort-buttons.js %}
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include add-buttons.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
{% include option-buttons.js %}
$(function(){
var $container = $('#container');
$container.isotope({
itemSelector : '.element',
masonry : {
@ -181,7 +149,43 @@ category: tests
}
}
});
{% include random-sizes.js %}
{% include sort-buttons.js %}
$('#filters').find('a').click(function(){
// get href attribute, minus the #, plus a . to make it a class
var filterName = '.' + $(this).attr('href').slice(1);
filterName = filterName === '.show-all' ? '*' : filterName;
$container.isotope({ filter: filterName })
return false;
});
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include add-buttons.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
{% include option-buttons.js %}
});
</script>
Loading…
Cancel
Save