Browse Source

docs : move click binding back into $(document).ready()

pull/96/head
David DeSandro 14 years ago
parent
commit
9db258d900
  1. 64
      _layouts/elements.html
  2. 11
      _posts/demos/2010-12-29-layout-modes.html
  3. 21
      _posts/demos/2010-12-30-filtering.html
  4. 13
      _posts/demos/2010-12-30-sorting.html
  5. 34
      _posts/demos/2010-12-31-relayout.html
  6. 25
      _posts/demos/2011-01-02-adding-items.html
  7. 41
      _posts/demos/2011-03-29-combination-filters.html

64
_layouts/elements.html

@ -54,46 +54,44 @@
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
$(function(){
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;
});
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');
});
{% include sort-buttons.js %}
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
{% include layout-change.js %}
// toggle variable sizes of all elements
$('#toggle-sizes').find('a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
{% include add-buttons.js %}
{% include layout-change.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
{% include add-buttons.js %}
{% include option-buttons.js %}
$('#shuffle a').click(function(){
$container.isotope('shuffle');
return false;
});
$(function(){
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element',

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

@ -25,14 +25,13 @@ related: layouts
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
var $container = $('#container');
$(function(){
var $container = $('#container');
{% include layout-change.js %}
{% include option-buttons.js %}
{% include layout-change.js %}
$(function(){
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element',

21
_posts/demos/2010-12-30-filtering.html

@ -39,19 +39,18 @@ related: filtering
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
var $container = $('#container');
$(function(){
var $container = $('#container');
// filter buttons
$('#filters a').click(function(){
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
return false;
});
{% include option-buttons.js %}
// filter buttons
$('#filters a').click(function(){
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
return false;
});
$(function(){
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element'

13
_posts/demos/2010-12-30-sorting.html

@ -26,15 +26,14 @@ related: sorting
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
var $container = $('#container');
{% include sort-buttons.js %}
{% include option-buttons.js %}
$(function(){
var $container = $('#container');
{% include sort-buttons.js %}
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.element',
getSortData : {

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

@ -25,26 +25,24 @@ related: methods
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
var $container = $('#container');
// toggle variable sizes of all elements
$('#toggle-sizes a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
$(function(){
var $container = $('#container');
// toggle variable sizes of all elements
$('#toggle-sizes a').click(function(){
$container
.toggleClass('variable-sizes')
.isotope('reLayout');
return false;
});
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
$container.isotope({
itemSelector: '.element',
masonry : {

25
_posts/demos/2011-01-02-adding-items.html

@ -31,22 +31,21 @@ related: methods
<script src="../{{ site.isotope_js }}"></script>
<script src="../js/fake-element.js"></script>
<script>
$(function(){
var $container = $('#container');
var $container = $('#container');
{% include add-buttons.js %}
{% include add-buttons.js %}
$('#prepend a').click(function(){
var $newEls = $( fakeElement.getGroup() );
$container
.prepend( $newEls ).isotope('reloadItems').isotope({ sortBy: 'original-order' })
// set sort back to symbol for inserting
.isotope('option', { sortBy: 'symbol' });
$('#prepend a').click(function(){
var $newEls = $( fakeElement.getGroup() );
$container
.prepend( $newEls ).isotope('reloadItems').isotope({ sortBy: 'original-order' })
// set sort back to symbol for inserting
.isotope('option', { sortBy: 'symbol' });
return false;
});
$(function(){
return false;
});
$container.isotope({
itemSelector : '.element',

41
_posts/demos/2011-03-29-combination-filters.html

@ -57,31 +57,30 @@ schema:
<script src="../{{ site.jquery_js }}"></script>
<script src="../{{ site.isotope_js }}"></script>
<script>
$(function(){
var $container = $('#container'),
filters = {};
var $container = $('#container'),
filters = {};
// filter buttons
$('.filter a').click(function(){
var $this = $(this),
isoFilters = [],
prop, selector;
// store filter value in object
// i.e. filters.color = 'red'
filters[ $this.data('group') ] = $this.data('filter');
// filter buttons
$('.filter a').click(function(){
var $this = $(this),
isoFilters = [],
prop, selector;
// store filter value in object
// i.e. filters.color = 'red'
filters[ $this.data('group') ] = $this.data('filter');
for ( prop in filters ) {
isoFilters.push( filters[ prop ] )
}
selector = isoFilters.join('');
$container.isotope({ filter: selector });
for ( prop in filters ) {
isoFilters.push( filters[ prop ] )
}
selector = isoFilters.join('');
$container.isotope({ filter: selector });
return false;
});
{% include option-buttons.js %}
return false;
});
$(function(){
{% include option-buttons.js %}
$container.isotope({
itemSelector : '.color-shape',

Loading…
Cancel
Save