mirror of https://github.com/metafizzy/isotope
David DeSandro
13 years ago
5 changed files with 156 additions and 3 deletions
@ -0,0 +1,118 @@
|
||||
--- |
||||
title: Unclickable filtered |
||||
layout: default |
||||
category: tests |
||||
body_class: demos |
||||
--- |
||||
|
||||
<style> |
||||
#container { |
||||
width: 50%; |
||||
} |
||||
|
||||
#clicked-display { |
||||
display: inline-block; |
||||
border: 1px dotted white; |
||||
font-size: 1.1em; |
||||
padding: 0 0.5em; |
||||
} |
||||
</style> |
||||
|
||||
<section id="copy"> |
||||
<p>For Internet Explorer and Opera, you might need to dismiss event on filtered out items. You should not be able to click on the big red blocks when filtered-out</p> |
||||
<p id="clicked-display">(Last item clicked)</p> |
||||
</section> |
||||
|
||||
<section id="options" class="clearfix"> |
||||
|
||||
<ul id="etc" class="clearfix"> |
||||
<li id="toggle-red"><a href="#toggle-red">Toggle big red blocks</a></li> |
||||
<li id="shuffle"><a href='#shuffle'>Shuffle</a></li> |
||||
</ul> |
||||
|
||||
</section> <!-- #options --> |
||||
|
||||
<div id="container" class="clearfix"> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape big red"><a href="#big-red-block"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape big red"><a href="#big-red-block"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape big red"><a href="#big-red-block"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
<div class="color-shape small blue round"><a href="#small-blue-circle"></a></div> |
||||
</div> |
||||
|
||||
|
||||
<script src="../{{ site.jquery_js }}"></script> |
||||
<script src="../{{ site.isotope_js }}"></script> |
||||
<script> |
||||
$(function(){ |
||||
|
||||
var $container = $('#container'), |
||||
isRedFiltered = true; |
||||
|
||||
$container.isotope({ |
||||
itemSelector : '.color-shape', |
||||
masonry: { |
||||
columnWidth: 80 |
||||
}, |
||||
hiddenStyle: { |
||||
opacity: 0.25 |
||||
} |
||||
}).isotope({ |
||||
filter: '.blue' |
||||
}).isotope('shuffle'); |
||||
|
||||
$('#toggle-red a').click(function(){ |
||||
isRedFiltered = !isRedFiltered; |
||||
var selector = isRedFiltered ? '.blue' : '*'; |
||||
$container.isotope({ filter: selector }); |
||||
return false; |
||||
}); |
||||
|
||||
$('#shuffle a').click(function(){ |
||||
$container.isotope('shuffle'); |
||||
return false; |
||||
}); |
||||
|
||||
var $clickedDisplay = $('#clicked-display'); |
||||
|
||||
$('.color-shape a').click(function(){ |
||||
var $this = $(this); |
||||
// back out if hidden item |
||||
if ( $this.parents('.isotope-item').hasClass('isotope-hidden') ) { |
||||
return; |
||||
} |
||||
$clickedDisplay.text( $(this).attr('href') ); |
||||
}); |
||||
|
||||
}); |
||||
</script> |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue