Created
August 3, 2010 08:48
-
-
Save juque/506067 to your computer and use it in GitHub Desktop.
jQuery: Menu Pipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * menú pipe | |
| * Muy simple plugin jQuery que | |
| * deja un separador entre los ítemes del | |
| * menú de navegación: | |
| * | |
| * Ejemplo: | |
| * | |
| * $(function(){ | |
| * $('#nav').menuPipe(); | |
| * }); | |
| * | |
| * Resultado: | |
| * | |
| * item | item | item | item | |
| * | |
| * @autor: Juan Pablo Aqueveque - juque.cl | |
| * | |
| */ | |
| (function($) { | |
| $.fn.menuPipe= function(settings) { | |
| var config = { | |
| separador : '|', | |
| envolturaA : '<span>', //abre | |
| envolturaC : '</span>' //cierra | |
| }; | |
| if (settings) $.extend(config, settings); | |
| this.each(function() { | |
| elemento = $(this).find('li').not(':last'); | |
| elemento.append(config.envolturaA+config.separador+config.envolturaC); | |
| }); | |
| return this; | |
| }; | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment