2017-10-28 144 views
0

我创建了一个自定义的SVG光标,并且无法响应链接。您可以从下面的例子看到您无法打开链接SVG光标没有响应标签

https://codepen.io/anon/pen/dZymZK

$(document).mousemove(function(e) { 
 
    $(".custom-cursor").position({ 
 
    my: "center center", 
 
    of: e, 
 
    collision: "fit" 
 
    }); 
 
});
:root { 
 
    cursor: url(http://chrishawkins.us/blank.cur), none; 
 
} 
 

 
.custom-cursor { 
 
    position: absolute; 
 
    cursor: none; 
 
} 
 
a:hover { 
 
cursor:pointer !important; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<svg id="pointer" height="50" width="50"> 
 
    <polygon points="1,1 49,10 20,20 10,49"> 
 
    <!-- coordinates are in x,y format --> 
 
    <!-- points go clockwise around the polygon --> 
 
</svg> 
 
    
 
    
 
    <a href="bbc.co.uk" target="_blank">bbc</a>

回答

1

请给下面的属性来选择#pointer:

position: relative; 

它应该工作。

+0

就这么简单!非常感谢 :) – Rob