javascript - External URL in Nav menu not working -


i'm trying menu link redirect target=_blank won't seem work. works if put code in own html file, not when on site

it "example" menu link having trouble with.

<!-- nav -->   <nav id="navigation" class="animated fadeinupbig shadow">     <ul id="nav">       <li class="current shadow"><a href="#section-1">home</a></li>       <li class="shadow"><a href="#section-2">about</a></li>       <li class="shadow"><a href="#section-3">services</a></li>       <li class="shadow"><a href="#section-4">events</a></li>       <li><a href="http://www.google.com" target="_blank">example</a></li>       <li class="shadow"><a href="#section-6">contact</a></li>     </ul> 

here mentions target in js

gethash: function($link) {             return $link.attr('href').split('#')[1];         },  getpositions: function() {             var self = this;             var linkhref;             var toppos;             var $target;              self.$nav.each(function() {                 linkhref = self.gethash($(this));                 $target = $('#' + linkhref);                  if($target.length) {                     toppos = $target.offset().top;                     self.sections[linkhref] = math.round(toppos) - self.config.scrolloffset;  handleclick: function(e) {             var self = this;             var $link = $(e.currenttarget);             var $parent = $link.parent();             var newloc = '#' + self.gethash($link); 

a quick search function names leads me believe using jquery-one-page-nav - meant navigation single page website internal links.
according readme file jquery-one-page-nav, need add class named "external" link in order external page link work:

<li><a href="http://google.com" class="external">some other link</a></li> 

popping new tab should simple adjustment there:

<li><a href="http://www.google.com" class="external" target="_blank">example</a></li> 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -