使用Opera自定义base64图像光标 - 可能吗?

时间:2012-07-09 17:32:30

标签: javascript html css html5 opera

我有以下Javascript:

document.getElementById("test").style.cursor =  
  "url('data:image/png;base64," +
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAdUlEQVR42qW" +
    "TSw7AIAhEZ8XCA3AFlt7/dG3SxEatQ1FIjGDg8Yu4HAHwHNeHBfSB7X0FQ+" +
    "/EMjM9BXjvuYWI3kOOAAPMGx7bzFQNtta22Bpohkgl2AmigBNICjDMLdP/B" +
    "xCB1Fr5Z2qiqhRgZv8AEaGAUspg3wU3VkqQQyYrAAAAAElFTkSuQmCC'), default";

它适用于 Google Chrome ,但不适用于 Opera 。可能的任何已知原因或解决方法?

相同的背景图片样式在Opera中工作正常>>

document.body.style.backgroundImage = 
  "url('data:image/png;base64," +
    "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAdUlEQVR42qW" +
    "TSw7AIAhEZ8XCA3AFlt7/dG3SxEatQ1FIjGDg8Yu4HAHwHNeHBfSB7X0FQ+" +
    "/EMjM9BXjvuYWI3kOOAAPMGx7bzFQNtta22Bpohkgl2AmigBNICjDMLdP/B" +
    "xCB1Fr5Z2qiqhRgZv8AEaGAUspg3wU3VkqQQyYrAAAAAElFTkSuQmCC')";

1 个答案:

答案 0 :(得分:4)

Opera不支持游标url,请参阅http://www.quirksmode.org/css/cursor.html