|
|
@ -23,6 +23,9 @@ category: demos |
|
|
|
<li><a href="#remove" data-option-value=".metalloid">metalloid</a></li> |
|
|
|
<li><a href="#remove" data-option-value=".metalloid">metalloid</a></li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ul id="add-remove"> |
|
|
|
|
|
|
|
<li><a href="#add-remove">Add / remove</a></li> |
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
|
|
</section> <!-- #options --> |
|
|
|
</section> <!-- #options --> |
|
|
|
|
|
|
|
|
|
|
@ -34,6 +37,7 @@ category: demos |
|
|
|
|
|
|
|
|
|
|
|
<script src="../{{ site.jquery_js }}"></script> |
|
|
|
<script src="../{{ site.jquery_js }}"></script> |
|
|
|
<script src="../{{ site.isotope_js }}"></script> |
|
|
|
<script src="../{{ site.isotope_js }}"></script> |
|
|
|
|
|
|
|
<script src="../js/fake-element.js"></script> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
$(function(){ |
|
|
|
$(function(){ |
|
|
|
|
|
|
|
|
|
|
@ -43,10 +47,26 @@ category: demos |
|
|
|
itemSelector : '.element' |
|
|
|
itemSelector : '.element' |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$('#removable a').click(function(){ |
|
|
|
$('#removable a').click( function( jQEvent ) { |
|
|
|
var selector = $(this).attr('data-option-value'); |
|
|
|
var selector = $(this).attr('data-option-value'); |
|
|
|
var $removable = $container.find( selector ); |
|
|
|
var $removable = $container.find( selector ); |
|
|
|
$container.isotope( 'remove', $removable ); |
|
|
|
$container.isotope( 'remove', $removable ); |
|
|
|
|
|
|
|
jQEvent.preventDefault(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#add-remove a').click( function( jQEvent ) { |
|
|
|
|
|
|
|
var $newEls = $( fakeElement.getGroup() ); |
|
|
|
|
|
|
|
var $firstTwoElems = $container.data('isotope') |
|
|
|
|
|
|
|
.$filteredAtoms.filter( function( i ) { |
|
|
|
|
|
|
|
return i < 2; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$container |
|
|
|
|
|
|
|
.isotope( 'insert', $newEls ) |
|
|
|
|
|
|
|
.isotope( 'remove', $firstTwoElems, function() { |
|
|
|
|
|
|
|
// console.log('items removed') |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
jQEvent.preventDefault(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// remove item if clicked |
|
|
|
// remove item if clicked |
|
|
@ -54,7 +74,6 @@ category: demos |
|
|
|
$container.isotope( 'remove', $(this) ); |
|
|
|
$container.isotope( 'remove', $(this) ); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|