2017-10-28 97 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