<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JS: мобильное меню не показывает 1 подпункт.]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=10497&amp;type=atom" />
	<updated>2015-03-14T01:18:43Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=10497</id>
		<entry>
			<title type="html"><![CDATA[JS: мобильное меню не показывает 1 подпункт.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=92508#p92508" />
			<content type="html"><![CDATA[<p>Использую такой скрипт:<br /></p><div class="codebox"><pre><code>/**
 * jQuery Mobile Menu 
 * Turn unordered list menu into dropdown select menu
 * version 1.0(31-OCT-2011)
 * 
 * Built on top of the jQuery library
 *   http://jquery.com
 * 
 * Documentation
 *   http://github.com/mambows/mobilemenu
 */
(function($){
$.fn.mobileMenu = function(options) {
  
 var defaults = {
   defaultText: &#039;Перейти к...&#039;,
   className: &#039;select-menu&#039;,
   subMenuClass: &#039;sub-menu&#039;,
   subMenuDash: &#039;&amp;ndash;&#039;
  },
  settings = $.extend( defaults, options ),
  el = $(this);
 
 this.each(function(){
  // ad class to submenu list
  el.find(&#039;ul&#039;).addClass(settings.subMenuClass);

  // Create base menu
  $(&#039;&lt;select /&gt;&#039;,{
   &#039;class&#039; : settings.className
  }).insertAfter( el );

  // Create default option
  $(&#039;&lt;option /&gt;&#039;, {
   &quot;value&quot;  : &#039;#&#039;,
   &quot;text&quot;  : settings.defaultText
  }).appendTo( &#039;.&#039; + settings.className );

  // Create select option from menu
  el.find(&#039;a,.separator&#039;).each(function(){
   var $this  = $(this),
     optText = $this.text(),
     optSub = $this.parents( &#039;.&#039; + settings.subMenuClass ),
     len   = optSub.length,
     dash;
   
   // if menu has sub menu
   if( $this.parents(&#039;ul&#039;).hasClass( settings.subMenuClass ) ) {
    dash = Array( len+1 ).join( settings.subMenuDash );
    optText = dash + optText;
   }
   if($this.is(&#039;span&#039;)){
    // Now build menu and append it
   $(&#039;&lt;optgroup /&gt;&#039;, {
    &quot;label&quot; : optText,
   }).appendTo( &#039;.&#039; + settings.className );
   }
   else{
    // Now build menu and append it
   $(&#039;&lt;option /&gt;&#039;, {
    &quot;value&quot; : this.href,
    &quot;html&quot; : optText,
    &quot;selected&quot; : (this.href == window.location.href)
   }).appendTo( &#039;.&#039; + settings.className );
   }

  }); // End el.find(&#039;a&#039;).each

  // Change event on select element
  $(&#039;.&#039; + settings.className).change(function(){
   var locations = $(this).val();
   if( locations !== &#039;#&#039; ) {
    window.location.href = $(this).val();
   }
  });
  $(&#039;.select-menu&#039;).hide();

 }); // End this.each
 
 return this;
};
})(jQuery);</code></pre></div><p>Он все меню показывает, кроме такой строки в html - вместо нее пустое место, но с переходом.<br /></p><div class="codebox"><pre><code>&lt;a href=&quot;http://www.facebook.com/Medial&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Facebook&quot; src=&quot;../assets/img/icons/35x35/facebook.png&quot; class=&quot;grayscale&quot;&gt;&lt;/a&gt;</code></pre></div><p>Эта строка показывается:<br /></p><div class="codebox"><pre><code>&lt;a href=&quot;../LAT/index.html&quot; style=&quot;margin: 0px 5px 0 20px; font-size: 12px&quot;&gt;&lt;span class=&quot;lang&quot;&gt;LAT&lt;/span&gt;&lt;/a&gt;</code></pre></div><p>Чтоб в него дописать, чтобы было в мобильном меню написано слово &quot;facebook&quot;?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-03-14T01:18:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=92508#p92508</id>
		</entry>
</feed>
