2010-04-30 44 views
0

我需要这样做:编辑CSS被JS在IE给错误

document.styleSheets[i].rules[1].style.cssText = "cursor: url(images/grabbing.cur), default !important;"; 

,如果我检查:

alert(document.styleSheets[i].rules[1].style.cssText); 

其捐赠:cursor: !important

为什么不设置整个字符串在这个CSS?

这只是在Internet Explorer中的问题,它适用于Firefox。

回答

0

一个简单的tipo:没有“,默认”需要。

在CSS

字符“”只是用来单独像一个清单:

font-family: tahoma, times; 

cursor酒店不接受意甲的值。

为你的CSS正确的形式:

cursor: url(images/grabbing.cur) !important; 

羽毛阅读:http://www.w3schools.com/css/pr_class_cursor.asp

+0

嘿它不工作也 我想这 document.styleSheets [I] .rules [1] .style.cssText =“cursor:url(images/grabbing.cur)!important;”; alert(document.styleSheets [i] .rules [1] .style.cssText); 它给予相同的 “光标:!重要”的警报值。 – user307635 2010-05-01 05:41:34