javascript - Append onclick to all but one link jquery -
i found code
function callback(e) { var e = window.e || e; if (e.target.tagname !== 'a') return; nanobar.go(100) } if (document.addeventlistener) document.addeventlistener('click', callback, false); else document.attachevent('onclick', callback); it's appending onclick , nano bar appears when link on page clicked, there's nice loading effect on youtube. there's 1 link shouldn't trigger nanobar, how exclude in code?
your code has exclusion rule (in case it's ignoring events elements other <a>), add exclusion so:
if (e.target.tagname !== 'a' || e.target.href.slice(-1) === "#") //exclude hash anchors return;
Comments
Post a Comment