jQuery Isotope:
Is there a way to keep the positioning intact, but making elements non click-able? demo here.
By adding another class instead of .element
, I loose the positio开发者_如何学Goning.
Sorry for not adding specific code examples, as I'm not sure where to fix this issue (markup, css or the jquery part)
Maybe
$(yourelement).css("cursor","auto");
?
The items are clickable only because there's this bit of script.
// change size of clicked element
$container.find('.element').live('click', function(){
$(this).toggleClass('large');
$container.isotope('reLayout');
});
You can change the CSS class to whatever you want, so long as it can be matched by the itemSelector
option
$container.isotope({
itemSelector: '.my-class'
});
If you want to make some elements non clickable you can just check that in the listener
var notClickable = ['Hg','Co','Rb']; // these element are not clickable
// change size of clicked element
$container.delegate( '.element', 'click', function(){
//if not in notClickable tab
if(jQuery.inArray( $(this).attr('data-symbol'), notClickable )==-1){
$(this).toggleClass('large');
$container.isotope('reLayout');
}
});
Demo here: http://jsfiddle.net/thomasNDS/bKtvN/1/
精彩评论