/** * @file * A JavaScript file for the theme. * * In order for this JavaScript to be loaded on pages, see the instructions in * the README.txt next to this file. */ // JavaScript should be made compatible with libraries other than jQuery by // wrapping it with an "anonymous closure". See: // - https://drupal.org/node/1446420 // - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth (function ($, Drupal, window, document, undefined) { //version 1-7 // To understand behaviors, see https://drupal.org/node/756722#behaviors Drupal.behaviors.mobile_menu_behavior = { attach: function(context, settings) { menu(); function menu(){ jQuery(function($) { 'use strict'; // ------------------------------------------------------------- // Basic Navigation // ------------------------------------------------------------- (function() { var $frame = $('.mobile-menu'); var $slidee = $frame.children('ul').eq(0); var $wrap = $frame.parent(); // Call Sly on frame $frame.sly({ horizontal: 1, itemNav: 'basic', smart: 1, activateOn: 'click', mouseDragging: 1, touchDragging: 1, releaseSwing: 1, startAt: 0, scrollBar: $wrap.find('.scrollbar'), scrollBy: 1, pagesBar: $wrap.find('.pages'), activatePageOn: 'click', speed: 300, elasticBounds: 1, easing: 'easeOutExpo', dragHandle: 1, dynamicHandle: 1, clickBar: 1, }); }()); $(".mobile-menu").hide(); }); }//cierro menu $(window).bind('resize', menu); }//cierro attach } Drupal.behaviors.mobile_logo_behavior = { attach: function(context, settings) { $(window).load(function() { if($("#mobile-navigation .logo").length > 0){ var $logo = '
' + $("#mobile-navigation .logo").html() + '
'; $("#mobile-navigation .header").before($logo); } }); }//cierro attach } Drupal.behaviors.mobile_closed_behavior = { attach: function(context, settings) { setTimeout(function () { if($(".mobile-menu").length > 0){ var $closed = '
'; $("#sabm-header-menu-1").before($closed); $('#botn-closed').on('click', function(){ $('#mobile-navigation .mobile-menu').slideUp(); }); } }, 150); }//cierro attach } Drupal.behaviors.mobile_open_behavior = { attach: function(context, settings) { setTimeout(function () { if($("#mobile-navigation .header").length > 0){ $('#mobile-navigation .header').on('click', function(){ $('#mobile-navigation .mobile-menu').slideDown("slow"); }); } }, 150); }//cierro attach }; })(jQuery, Drupal, this, this.document);