2012-01-07 34 views

答えて

10

要素を作成してプロパティを設定し、プロパティがまだ存在するかどうかを確認するだけです。

function isCursorNoneSupported() { 
    var a = document.createElement("a"); 
    a.style.cursor = "none"; 
    return a.style.cursor === 'none'; 
} 

if (isCursorNoneSupported()) { 
    alert("cursor:none is supported!"); 
} else { 
    alert("cursor:none is not supported :("); 
} 

は、ブラウザは、 cursor:noneをサポートして見ていた確認するには: cursor Browser compatibility

+0

偉大な答えを、アップ投票したが、 '==='恒等演算子である@refhat理由===と – defau1t

+2

を==ません。この場合、両方のオブジェクトが文字列であるため、 '=='または '==='を使用しているかどうかは関係ありません。 '===' vs '=='の詳細については、[JavaScript === vs ==:どのような "等しい"演算子を使用するのか?](http://stackoverflow.com/questions/359494/)を参照してください。 javascript-vs-does-it-matter-which-equal-operator-i-use) –

関連する問題