Title: Adding colomat-close class at certain width
Last modified: August 21, 2016

---

# Adding colomat-close class at certain width

 *  [mazecreative](https://wordpress.org/support/users/mazecreative/)
 * (@mazecreative)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/adding-colomat-close-class-at-certain-width/)
 * LOVE this plugin.
 * I’m displaying the collapse/expand trigger <800px wide as I want my sidebar to
   appear normal and expanded over 800px. However, I want the sidebar to automatically
   collapse under 800px, so I tried the following jQuery:
 *     ```
       function checkWidth(init)
       		{
       		    /*If browser resized, check width again */
       		    if ($(window).width() < 800) {
       		        $('#collapse1').removeClass('colomat-close');
       		    }
       		    else {
       		        if (!init) {
       		            $('#collapse1').addClass('colomat-close');
       		        }
       		    }
       		}
       ```
   
 * With the following HTML:
 *     ```
       <span class="collapseomatic colomat-close" id="collapse1">Filter</span>
       		<span id="swap-collapse1" style="display: none;">Close Filter</span>
       		<div class="collapseomatic_content" id="target-collapse1">
       			<?php dynamic_sidebar( 'Sidebar' ); ?>
       		</div>
       ```
   
 * But the sidebar just stays expanded even under 800px.
 * Any ideas?
 * [http://wordpress.org/extend/plugins/jquery-collapse-o-matic/](http://wordpress.org/extend/plugins/jquery-collapse-o-matic/)

The topic ‘Adding colomat-close class at certain width’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jquery-collapse-o-matic_fffeff.svg)
 * [Collapse-O-Matic](https://wordpress.org/plugins/jquery-collapse-o-matic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jquery-collapse-o-matic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jquery-collapse-o-matic/)
 * [Active Topics](https://wordpress.org/support/plugin/jquery-collapse-o-matic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jquery-collapse-o-matic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jquery-collapse-o-matic/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mazecreative](https://wordpress.org/support/users/mazecreative/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/adding-colomat-close-class-at-certain-width/)
 * Status: not resolved