Ver Mensaje Individual
  #7 (permalink)  
Antiguo 07/05/2014, 16:08
Avatar de el_cesar
el_cesar
 
Fecha de Ingreso: mayo-2001
Ubicación: Cali
Mensajes: 2.423
Antigüedad: 23 años
Puntos: 20
Respuesta: Menú responsive con imágenes

Zeromm, Gracias por la sugerencia, sin embargo hice la prueba con el segundo ejemplo que me das

lo implementé de la siguiente manera:

index
Código PHP:
Ver original
  1. <head>
  2.     <link rel="stylesheet" type="text/css" href="estilos2.css" />
  3.     <script type="text/javascript">
  4. $(document).ready(function() {
  5.           /*! http://tinynav.viljamis.com v1.03 by @viljamis */
  6.             (function ($, window, i) {
  7.               $.fn.tinyNav = function (options) {
  8.            
  9.                 // Default settings
  10.                 var settings = $.extend({
  11.                   'active' : 'selected', // String: Set the "active" class
  12.                   'header' : false // Boolean: Show header instead of the active item
  13.                 }, options);
  14.            
  15.                 return this.each(function () {
  16.            
  17.                   // Used for namespacing
  18.                   i++;
  19.            
  20.                   var $nav = $(this),
  21.                     // Namespacing
  22.                     namespace = 'tinynav',
  23.                     namespace_i = namespace + i,
  24.                     l_namespace_i = '.l_' + namespace_i,
  25.                     $select = $('<select/>').addClass(namespace + ' ' + namespace_i);
  26.            
  27.                   if ($nav.is('ul,ol')) {
  28.            
  29.                     if (settings.header) {
  30.                       $select.append(
  31.                         $('<option/>').text('Navigation')
  32.                       );
  33.                     }
  34.            
  35.                     // Build options
  36.                     var options = '';
  37.            
  38.                     $nav
  39.                       .addClass('l_' + namespace_i)
  40.                       .find('a')
  41.                       .each(function () {
  42.                         options +=
  43.                           '<option value="' + $(this).attr('href') + '">' +
  44.                           $(this).text() +
  45.                           '</option>';
  46.                       });
  47.            
  48.                     // Append options into a select
  49.                     $select.append(options);
  50.            
  51.                     // Select the active item
  52.                     if (!settings.header) {
  53.                       $select
  54.                         .find(':eq(' + $(l_namespace_i + ' li')
  55.                         .index($(l_namespace_i + ' li.' + settings.active)) + ')')
  56.                         .attr('selected', true);
  57.                     }
  58.            
  59.                     // Change window location
  60.                     $select.change(function () {
  61.                       window.location.href = $(this).val();
  62.                     });
  63.            
  64.                     // Inject select
  65.                     $(l_namespace_i).after($select);
  66.            
  67.                   }
  68.            
  69.                 });
  70.            
  71.               };
  72.             })(jQuery, this, 0);
  73.            
  74.             $(".nav-list").tinyNav();});
  75.  
  76.     </script>
  77. </head>
  78.  
  79. <!--Pattern HTML-->
  80.   <div id="pattern" class="pattern">
  81.         <!--Begin Pattern HTML-->
  82.         <nav class="navigation" role="navigation">
  83.             <ul class="nav-list">
  84.                  <li><a href="#">Home</a></li>
  85.                  <li><a href="#">Products</a></li>
  86.                  <li><a href="#">Services</a></li>
  87.                  <li><a href="#">Locations</a></li>
  88.                  <li><a href="#">About</a></li>
  89.                  <li><a href="#">Contact Us</a></li>
  90.             </ul>
  91.         </nav>
  92.     </div>
  93.     <!--End Pattern HTML-->
  94.    
  95.     <div class="container">
  96.         <section class="pattern-description">
  97.             <h1>Select Menu</h1>
  98.             <p>One way of taming nav links gone wild is to transform a list of links into a select menu for small screens. This is a clever way to save real estate.</p>
  99.             <h3>Pros</h3>
  100.             <ul>
  101.                 <li><strong>Frees up plenty of space</strong>- a select menu definitely takes up a lot less space than a horizontal or vertical list of links </li>
  102.                 <li><strong>Keeps interactions in the header</strong>- instead of a footer nav, the select menu keeps the navigation functionality in the header, where users are used to seeing web navigation</li>
  103.                 <li><strong>Easily Recognizable</strong>- a select menu with a clear label saying &#8220;navigation” or “menu” is definitely easy for users to figure out.  </li>
  104.                 <li><strong>Pulls up native controls</strong>- each mobile browser will handle select menus their own way. Touch devices will pull up the nav in a touch friendly list, while trackball/d-pad/pearl devices will pull up a select menu more conducive to that particular input method.</li>
  105.             </ul>
  106.             <h3>Cons</h3>
  107.             <ul>
  108.                 <li><strong>Lack of styling control</strong>- select menus are a pain in the ass to style. Each browser handles them in their own, usually clunky, way. Forget about cross-browser styling and coming out with anything that looks halfway consistent. As a result, the select menu can stick out like a sore thumb and really dirty up an otherwise good-lookin&#8217; design.</li>
  109.                 <li><strong>Potentially confusing</strong> &#8211; Users are used to select menus in the context of filling out a form, but I’m not sure they’d grasp a form element out of that context. This is simply a hunch, so it would be interesting to test.</li>
  110.                 <li><strong>Handling subnav items</strong>- nested lists handled by select menus can look weird. Child categories are usually handled by <a href="http://media.smashingmagazine.com/wp-content/uploads/2011/12/prog-resp-nav_13.jpg">indenting with dashes</a>, and while it might get the point across I see it as potentially confusing and a little ugly.</li>
  111.                 <li><strong>Javascript dependency</strong>- It doesn&#8217;t require too much JS to convert the list to a select menu, but it’s worth pointing out simply because mobile browsers do the dardest things. But again, the technique is pretty cut and dry so there shouldn’t be too many hang ups using this approach.</li>
  112.             </ul>
  113.             <h3>Resources</h3>
  114.             <ul>
  115.                 <li><a href="http://tinynav.viljamis.com/">TinyNav</a> by <a href="https://twitter.com/viljamis">@viljamis</a></li>
  116.                 <li><a href="http://css-tricks.com/convert-menu-to-dropdown/">Convert a Menu to a Dropdown for Small Screens</a></li>
  117.                 <li><a href="http://coding.smashingmagazine.com/2012/02/13/progressive-and-responsive-navigation/">Progressive and Responsive Navigation</a></li>
  118.                 <li><a href="https://github.com/mattkersley/Responsive-Menu">Responsive Menu</a></li>
  119.             </ul>
  120.             <h3>In the Wild</h3>
  121.             <ul>
  122.                 <li><a href="http://viljamis.com/">Viljami Salminen</a></li>
  123.                 <li><a href="http://retreats4geeks.com/">Retreats 4 Geeks</a></li>
  124.                 <li><a href="http://www.fivesimplesteps.com">Five Simple Steps</a></li>
  125.                 <li><a href="http://www.performancemarketingawards.co.uk/">Performance Marketing Awards</a></li>
  126.             </ul>
  127.         </section>
  128.         <footer role="contentinfo">  
  129.             <div>
  130.                 <nav id="menu">
  131.                     <a href="http://www.forosdelweb.com/f53/patterns.html">&larr;More Responsive Patterns</a>
  132.                 </nav>
  133.             </div>
  134.         </footer>
  135.     </div>

estilos2.css

Código CSS:
Ver original
  1. .navigation {
  2.         padding: 1em;
  3.         }
  4.         select {
  5.             width: 100%;
  6.         }
  7.         .nav-list {
  8.             overflow: hidden;
  9.         }
  10.         .nav-list li {
  11.             float: left;
  12.             margin-right: 1em;
  13.         }
  14.        
  15.         /* styles for desktop */
  16.         .tinynav { display: none }
  17.        
  18.         /* styles for mobile */
  19.         @media screen and (max-width: 37.5em) {
  20.             .tinynav { display: block }
  21.             .nav-list { display: none }
  22.         }

y lo que sucede es, cuando reduzco el ancho de la pantalla, se desaparece el menú pero no me aparece el menu desplegable, sabes que puede estar pasando?
__________________
Say no more.......