toggle one div at the time with masonry
Hello all looked up google, this forum but could not find a solution. Hope i can get some advice.
i have several divs.
i'd like to only open one at the time.this is my html and i have several, up to ten such sections on my page.
- <div class="detailList">
-
- <div class="detail intel">
- <div class="item-content"><p>Procesador: Intel® Atomâ„¢</p></div>
- </div>
- <div class="detail monitor">
- <div class="item-content"><p>Pantalla: 7"</p></div>
- </div>
- <div class="detail os">
- <div class="item-content"><p>Sistema operativo: Android* 4.4, KitKat</p></div>
- </div>
- <div class="detail memory">
- <div class="item-content"><p>Memoria RAM: 1 GB</p></div>
- </div>
- <div class="detail hd">
- <div class="item-content"><p>Almacenamiento: 16 GB eMMC</p></div>
- </div>
-
- </div> <!-- end detail list -->
This is the js
- (function($){
-
-
- $( function() {
-
- var $container = $('.detailList').masonry({
- columnWidth: 2
- });
-
- $container.on( 'click', '.item-content', function() {
- $( this ).parent('.detail').toggleClass('is-expanded');
- $container.masonry();
- });
-
- });
-
- })($.noConflict(true));
How could i make this work so that only one of the 'item-conent' divs opens at one time?
thank you
D