Hi,
I’m using this code to animate scrolling on all my anchor tags:
$(‘a[href*=#]:not([href=#])’).click(function() {
if (location.pathname.replace(/^//,”) == this.pathname.replace(/^//,”)
|| location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $(‘[name=’ + this.hash.slice(1) +’]’);
if (target.length) {
$(‘html,body’).animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
The code works great but I have some links in an SVG and it’s not targeting them. jQuery doesn’t seem to recognize the attribute “xlink:href”. Is there any way to accomplish this?
Thanks in advance.