pablocattaneo
6/24/2015 - 3:59 PM

menu.js

  <script>
		/* Menu desplegable para mobile*/
		(function($) {
		  $.fn.collapsable = function(options) {
		    // iterate and reformat each matched element
		    return this.each(function() {
		      // cache this:
		      var obj = $(this);
		      var tree = obj.next("div[class^='menu-'"); // El elemento que contenga el menú a ocultar y mostar
		      obj.click(function(){
		        if( obj.is(':visible') ){ tree.toggle();}
		      });
		      $(window).resize(function(){
		        if ( $(window).width() <= 800 ){tree.attr('style','');};
		      });
		    });
		  };
		})(jQuery);
		$('selector del elemento que despliega el contenido ').collapsable();
  </script>