javascript - Pure-CSS / YUI - horizontal menu, target = _blank doesn't open new window or tab -
using yui , pure-css, i've created horizontal nav menu. 1 link ("messenger") has open new window or tab (target = "_blank") javascript ignoring , opening link in current window.
the html/css is:
<div id="demo-horizontal-menu"> <ul id="std-menu-items"> <li class="pure-menu-selected"><a href="#">flickr</a></li> <li><a href="http://cnn.com" target="_blank">messenger</a></li> <li><a href="#">sports</a></li> <li><a href="#">finance</a></li> <li> <a href="#">other</a> <ul> <li class="pure-menu-heading">more yahoo!</li> <li class="pure-menu-separator"></li> <li><a href="#">autos</a></li> <li><a href="#">flickr</a></li> <li><a href="#">answers</a></li> <li> <a href="#">even more</a> <ul> <li><a href="#">horoscopes</a></li> <li><a href="#">games</a></li> <li><a href="#">jobs</a></li> <li><a href="#">omg</a></li> </ul> </li> </ul> </li> </ul> </div>
the javascript is:
yui({ classnameprefix: 'pure' }).use('gallery-sm-menu', function (y) { var horizontalmenu = new y.menu({ container : '#demo-horizontal-menu', sourcenode : '#std-menu-items', orientation : 'horizontal', hideonoutsideclick: false, hideonclick : false }); horizontalmenu.render(); horizontalmenu.show(); });
here's fiddle:
http://jsfiddle.net/k8qmy/607/
there seem several similar issues these libraries, deal using onclick track new window or forcing new window opposed new tab.
your fiddle (http://jsfiddle.net/p3a9p/) opening messenger link in new tab me.
target="_blank" //appears working me.
possibly environmental issue , not code? browser using? date?
i using google chrome version 29.0.1547.66 m
Comments
Post a Comment