PATH:
home
/
letacommog
/
letaweb
/
scripts
/
libraries
(function($){ //plugin's default options var settings = { prependTo: 'nav', //insert at top of page by default switchWidth: 768, //width at which to switch to select, and back again topOptionText: 'Select a page:' //default "unselected" state }, menuCount = 0, //used as a unique index for each menu if no ID exists uniqueLinks = []; //used to store unique list items for combining lists //go to page function goTo(url){document.location.href = url;} //does menu exist? function menuExists(){return ($('.mnav').length) ? true : false;} //validate selector's matched list(s) function isList($this){ var pass = true; $this.each(function(){ if(!$(this).is('ul') && !$(this).is('ol')){ pass=false; } }); return pass; }//isList() //function to decide if mobile or not function isMobile(){return ($(document).width() < settings.switchWidth);} //function to get text value of element, but not it's children function getText($item){return $.trim($item.clone().children('ul, ol').remove().end().text());} //function to check if URL is unique function isUrlUnique(url){return ($.inArray(url, uniqueLinks) === -1) ? true : false;} //function to create options in the select menu function createOption($item, $container, text){ //if no text param is passed, use list item's text, otherwise use settings.groupPageText var $selected='', $disabled='', $sel_text=''; if ($item.hasClass('current')) $selected='selected'; if ($item.hasClass('disabled')) { if ($('.current').length) $disabled='disabled'; else $disabled='selected'; } $sel_text=$.trim(getText($item)); $sel_text = $sel_text.replace('»', ''); if ($item.parent('ul ul').length) $sel_text = ' – ' + $sel_text; if ($item.parent('ul ul ul').length) $sel_text = '– ' + $sel_text; if ($item.parent('ul ul ul ul').length) $sel_text = '– ' + $sel_text; if(!text){$('<option value="'+$item.find('a:first').attr('href')+'" ' + $selected + ' ' + $disabled + '>' + $sel_text +'</option>').appendTo($container);} else {$('<option value="'+$item.find('a:first').attr('href')+'" ' + $selected + ' ' + $disabled + '>'+text+'</option>').appendTo($container);} }//createOption() //function to create submenus function createGroup($group, $container){ //loop through each sub-nav list $group.children('ul, ol').each(function(){ $(this).children('li').each(function(){ createOption($(this), $container); $(this).each(function(){ var $li_ch = $(this), $container_ch = $container; createGroup($li_ch, $container_ch); }); }); }); }//createGroup() //function to create <select> menu function createSelect($menu){ //create <select> to insert into the page var $select = $('<select id="mm'+menuCount+'" class="mnav">'); menuCount++; //create default option if the text is set (set to null for no option) if(settings.topOptionText){createOption($('<li class="disabled"><a href="#">'+settings.topOptionText+'</a></li>'), $select);} //loop through first list items $menu.children('li').each(function(){ var $li = $(this); //if nested select is wanted, and has sub-nav, add optgroup element with child options if($li.children('ul, ol').length){ createOption($li, $select); createGroup($li, $select); } //otherwise it's a single level select menu, so build option else {createOption($li, $select);} }); //add change event and prepend menu to set element $select .change(function(){goTo($(this).val());}) .prependTo(settings.prependTo); }//createSelect() //function to run plugin functionality function runPlugin(){ //menu doesn't exist if(isMobile() && !menuExists()){ $menus.each(function(){ createSelect($(this)); }); } //menu exists, and browser is mobile width if(isMobile() && menuExists()){ $('.mnav').show(); $menus.hide(); } //otherwise, hide the mobile menu if(!isMobile() && menuExists()){ $('.mnav').hide(); $menus.show(); } }//runPlugin() //plugin definition $.fn.mobileMenu = function(options){ //override the default settings if user provides some if(options){$.extend(settings, options);} //check if user has run the plugin against list element(s) if(isList($(this))){ $menus = $(this); runPlugin(); $(window).resize(function(){runPlugin();}); } else { alert('mobileMenu only works with <ul>/<ol>'); } };//mobileMenu() })(jQuery);
[+]
..
[+]
jQuery-Tags-Input
[-] countdown.js
[edit]
[-] owl.carousel.js
[edit]
[-] base.js
[edit]
[-] jquery.ui.core.js
[edit]
[+]
select2
[-] jquery.matchHeight-min.js
[edit]
[+]
master-slider
[-] jquery.metadata.js
[edit]
[+]
owl-carousel
[-] dataTables.columnFilter.js
[edit]
[-] codemirror.js
[edit]
[+]
jqvmap
[-] css.js
[edit]
[-] jquery.ui.button.js
[edit]
[-] jquery.vticker.min.js
[edit]
[-] jwplayer.js
[edit]
[-] masonry.pkgd.js
[edit]
[-] jquery.smartmenus.min - Copy.js
[edit]
[-] jquery.ui.widget.js
[edit]
[-] jquery.ba-resize.min.js
[edit]
[-] jquery-ui-timepicker.js
[edit]
[-] jquery-migrate.js
[edit]
[-] jquery.nearest.min.js
[edit]
[-] swfobject.js
[edit]
[-] javascript.js
[edit]
[-] jquery.validate.password.js
[edit]
[-] jquery.colorbox.js
[edit]
[-] flexigrid.js
[edit]
[-] jquery.smartmenus.min.js
[edit]
[-] jcarousellite.js
[edit]
[+]
ckeditor_standard
[-] twig.min.js
[edit]
[-] superfish.js
[edit]
[-] bootstrap.min - Copy.js
[edit]
[-] jquery.dataTables.min.js
[edit]
[-] mustache.js
[edit]
[-] spectrum.js
[edit]
[-] jquery.ui.droppable.js
[edit]
[-] jquery.isotope.js
[edit]
[-] jquery.ui.slider.js
[edit]
[-] htmlmixed.js
[edit]
[-] jquery.tinycarousel.min.js
[edit]
[-] jquery.ui.sortable.js
[edit]
[-] jquery.hover.js
[edit]
[-] wow.min.js
[edit]
[-] jquery.fittext.js
[edit]
[+]
jquery.validate
[-] jquery.ui.draggable.js
[edit]
[-] jquery.ui.resizable.js
[edit]
[-] audio.min.js
[edit]
[+]
angular
[+]
less
[-] masonry.pkgd.min.js
[edit]
[+]
plupload
[-] jquery.rd-parallax.js
[edit]
[-] tabs.js
[edit]
[-] responsive.js
[edit]
[-] xml.js
[edit]
[-] expressInstall.swf
[edit]
[-] camera.js
[edit]
[-] pace.min.js
[edit]
[-] typed.js
[edit]
[-] jquery.nivo.slider.js
[edit]
[+]
bootstrap
[-] qtip.js
[edit]
[+]
mediaelement
[-] jquery.ui.mouse.js
[edit]
[+]
slick
[-] countUp.js
[edit]
[-] jquery.prettyPhoto.js
[edit]
[+]
ckeditor_full
[-] jquery.ui.spinner.js
[edit]
[-] portfolio-layout-plugin.js
[edit]
[-] require.js
[edit]
[-] nicEdit.js
[edit]
[-] jquery.json-2.4.min.js
[edit]
[-] jquery.ba-resize.js
[edit]
[-] jquery.mobilemenu.js
[edit]
[+]
nivo_slider
[+]
ui-iconpicker
[-] cloud-zoom.js
[edit]
[-] jquery.ui.datepicker.js
[edit]
[-] jquery.cycle.all.js
[edit]
[-] jquery.validate.js
[edit]
[+]
flot
[+]
jquery-ui
[-] jquery.cleditor.min.js
[edit]
[-] jquery.easing.js
[edit]
[-] jquery.elevateZoom.min.js
[edit]
[-] bootstrap.min.js
[edit]
[-] jquery.bxslider.js
[edit]
[-] mediaelement-and-player.min.js
[edit]
[-] jquery.zoom-min.js
[edit]
[-] jquery.nearest.js
[edit]
[-] jquery.autosize.js
[edit]