2011-07-05 17 views
2

我已經創建了一個.png文件,我想將它用作類「next」的特定元素上的自定義光標。我正在使用此代碼無濟於事。我錯過了什麼?通過jQuery.css定製光標圖形()

$('.next').hover 
(
    function(e) 
    { 
    //$(this).css('cursor','all-scroll'); //WORKS! 
    $(this).css('cursor','url(img/right-pointer.png)'); 
    }); 
+0

是文件位置嗎?有沒有可能你需要/img/right-pointer.png? – dave

+0

http://plugins.jquery.com/project/customcursor –

+0

戴夫,就是這樣。一旦我硬編碼它的URL的作品。 –

回答

6

你爲什麼不使用下面的CSS:

.next:hover { cursor:url(img/right-pointer.png); }

+0

簡單明智。 – MacMac