JQuery Hilight插件的任何替代品?

cwa*_*wap 5 jquery rollover-effect

当我发现Hilight时,我差点摔倒在椅子上.这正是我需要的:)

现在,令人遗憾的是,该演示似乎在IE8中不起作用.那里有任何修复或替代方案吗?

Sol*_*ogi 12

我通过maphilight源代码进行了调试,发现IE8在为新创建的样式表添加规则时会发出窒息.当我在Google上搜索这个特定问题时,我发现了一个关于OpenLayer轨道的错误报告.错误报告有一个补丁,我在maphilight插件上使用这个补丁来修复它.

这是你需要做的.打开jquery.maphilight.js(未压缩的源代码)并转到第63行,您将看到以下内容:

document.createStyleSheet().addRule("v\\:*", "behavior: url(#default#VML); antialias: true;"); //IE8 chokes on this line.
document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
Run Code Online (Sandbox Code Playgroud)

将以上内容替换为:

document.namespaces.add("v", "urn:schemas-microsoft-com:vml"); 
var style = document.createStyleSheet();
var shapes = ['shape','rect', 'oval', 'circ', 'fill', 'stroke', 'imagedata', 'group','textbox'];  
$.each(shapes,
    function()
    {
        style.addRule('v\\:' + this, "behavior: url(#default#VML); antialias:true");
    }
);
Run Code Online (Sandbox Code Playgroud)

它现在应该在IE8中工作.这是证明,看看怀俄明州是如何突出的.

我不确定这是否适用于IE6和IE7.你必须自己测试一下.如果在IE6和IE7中中断,则只有在浏览器为IE8时才需要放置此补丁.

再一次,将上述补丁归功于原作者.我只在maphilight插件中调试了这个问题.