SVG css3 transition on fill not working when there is external link

后端 未结 4 900
孤独总比滥情好
孤独总比滥情好 2021-01-05 18:30

I have a problem similar to this one : here.

Only difference is that the page I want to link the SVG to is an external page meaning : http://www.google.ca

C

4条回答
  •  日久生厌
    2021-01-05 18:42

    I just changed the anchor into a div and appended a data attribute to it which contains the URL:

    
    

    Than I added some JavaScript to get the URL and to append it to the location object:

    document.getElementById("homeLink").addEventListener('click',function(){
        var url = this.getAttribute('data-url');
        window.location.href = url;
    },false);
    

提交回复
热议问题