砌体,单击新项目时删除“is_expanded”类
Masonry, remove "is_expanded" class when new item is clicked
我正在使用像 http://masonry.desandro.com/methods.html#layout 这样的布局,并且想知道是否有一种方法可以在他们时间只激活一个项目。这样,当您展开一个新项目时,您当前打开的项目将恢复其原始形式(删除class="is_expanded") 。我对编程很陌生,真的不知道在哪里看统计,尝试配置 单击其他项目时如何从以前的选择中删除类?但没有运气
classie.toggle( event.target, 'gigante' );
这是魔术的部分 - 它添加了一个类"gigante",然后使其成为 4*4(或其他什么)
如果您一次只想扩展一个,那么
eventie.bind( container, 'click', function( event ) {
// don't proceed if item was not clicked on
if ( !classie.has( event.target, 'item' ) ) {
return;
}
// change size of item via class
$('.item').removeClass('gigante'); // add this line
classie.toggle( event.target, 'gigante' );
// trigger layout
msnry.layout();
});
我添加的行的作用是从项目中删除所有"gigante"类,然后切换会将该类再次添加到项目中。
$('.item')
只是每个项目都有的类。
这个答案假设只有扩展的项目才会被称为"巨型"。
相关文章:
- Is onfling available for html, html5
- jQuery is not loaded
- reactRedux is not defined
- ReferenceError: cordova is not defined @ng-cordova.min.js:7
- Jquery - table.row(tr) is undefined
- contentWindow.document.body is null
- Tomcat websocket is not working
- noty.js is returning undefined
- $routeParams is undefined
- NodeJS Multer is not working
- React, Webpack: bundle.js is not generated
- jQuery is not defined - WordPress footer.php
- 谷歌地图API v3:Initial View is Fine,but Gray Box with No Map if
- imageArray[i] = imageItem is incompatible
- GAPI Is Not Defined
- Angular2 rc1, where is shims_for_IE
- Is (!~index) faster than (index === -1)?
- Mouse Out Orange Div "CurrentHeight" is not applyi
- Is jquery's attr() asynchronous?
- Rxjs5, distinct() is not working