/* slinky a light-weight, responsive, mobile-like navigation menu plugin for jquery built by ali zahid published under the mit license */ ;(function($) { $.fn.slinky = function(options) { // setup plugin defaults var settings = $.extend({ label: 'back', title: false, speed: 300, resize: true }, options); // convenience method for navigation animation var move = function(menu, next, callback) { var left = math.round(parseint(menu.get(0).style.left)) || 0; // use multiples of 100% for responsive animation menu.css('left', -math.abs(next ? left - 100 : left + 100) + '%'); // callback after animation is finished if (typeof callback === 'function') { settimeout(callback, settings.speed); } }; // convenience method for resizing menu var resize = function(menu, content) { menu.height(content.outerheight()); }; return this.each(function() { // the root node is where animation happens var menu = $(this), root = menu.children().first(); // set css animation duration menu.css('transition-duration', settings.speed + 'ms'); root.css('transition-duration', settings.speed + 'ms'); // add .next class to links with sub menus $('a + ul', menu).prev().addclass('next'); // add header for back button and title $('li > ul', menu).prepend('