Note that there are some explanatory texts on larger screens.

plurals
  1. POthis.href not returning href
    primarykey
    data
    text
    <p>I am not sure if it is because I am using Wordpress but the <code>this.href</code> is not returning the href on the items that have them (for example on "contact" it returns <a href="http://www.domain.net/undefined" rel="nofollow">http://www.domain.net/undefined</a> opposed to <a href="http://www.domain.net/contact" rel="nofollow">http://www.domain.net/contact</a>). If I remove the script the nav loads the href just fine.</p> <p>Here is the JS</p> <pre><code>$(document).ready(function() { $('#page-wrap').delay(500).fadeIn(1000); $(".menu-item").click(function(event){ event.preventDefault(); linkLocation = this.href; $("#page-wrap").fadeOut(1000, redirectPage); }); function redirectPage() { window.location = linkLocation; } }); </code></pre> <p>Here is the php wordpress file</p> <pre><code>&lt;div id="nav_wrap"&gt; &lt;div id="nav"&gt;&lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'header-menu',) ); ?&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Here is what wordpress returns in html format</p> <pre><code>&lt;div id="nav_wrap"&gt; &lt;div id="nav"&gt;&lt;div class="menu-main-container"&gt;&lt;ul id="menu-main" class="menu"&gt;&lt;li id="menu-item-13" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-13"&gt;&lt;a href="http://www.domain.net"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li id="menu-item-28" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-28"&gt;&lt;a&gt;Company&lt;/a&gt; &lt;ul class="sub-menu"&gt; &lt;li id="menu-item-32" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-32"&gt;&lt;a href="http://www.domain.net/jobs/"&gt;Careers&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li id="menu-item-29" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-29"&gt;&lt;a&gt;Portfolio&lt;/a&gt; &lt;ul class="sub-menu"&gt; &lt;li id="menu-item-65" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-65"&gt;&lt;a href="http://www.domain.net/breweries/"&gt;Breweries&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li id="menu-item-30" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-30"&gt;&lt;a&gt;Retailer Resources&lt;/a&gt;&lt;/li&gt; &lt;li id="menu-item-31" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-31"&gt;&lt;a&gt;Community&lt;/a&gt;&lt;/li&gt; &lt;li id="menu-item-15" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-15"&gt;&lt;a href="http://www.domain.net/contact/"&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;/div&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload