I am having issues with map highlight working properly on IE8. Seems to be fine with firefox, safari and earlier versions of IE

Comments

darioshanghai’s picture

Title: Internet Explorer 8 » Won't work on Internet Explorer 8
Priority: Normal » Critical
Status: Active » Patch (to be ported)

It doesn't work on Internet Explorer 8.
The following patch from here fixes the issue. In my case applying the patch and recompressing the javascript file didn't work, so I just uploaded the uncompressed version and renamed it.

It is need to replace lines 63 and 64 in uncompressed file:

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

Replacement:

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");
    }
);
tomuntz105’s picture

This works for the jquery.maphilight.js but the required file is jquery.maphiligh.min.js. Any idea what needs to be modified in the .min file?

darioshanghai’s picture

The .min file is a compressed version of the same file. Compressing didn't work for me, so I just renamed jquery.maphilight.js and that works.

tomuntz105’s picture

Perfect. Thanks

akolahi’s picture

Any chance of getting a patch applied?

WorldFallz’s picture

Status: Patch (to be ported) » Closed (works as designed)

@darioshanghai thanks for posting the fix!

The jquery plugin is what needs to be patched-- the module just has php to create a drupal module that wraps the plugin and exposes the settings. Maybe post over at the plugin's page linked above.

akolahi’s picture

okay thanks. The patch worked for me too. Thank you!

t14’s picture

yes works for me too.

Just in case anyone gets stuck;

I had a problem because there are two "jquery.maphilight.min.js", one in "jquery_plugin" folder and another in the "maphilight-1.1.2" folder. I replaced both of them with the "jquery.maphilight.js"(renamed to: jquery.maphilight.min.js) file that I added this patch too and it worked fine.

Not sure if I needed to change both files or just one, or wether this was the best way to do it as it defeats the point of having a compressed version if its just the same as the uncompressed version.

Anyhow I am very greatfull for this patch thank you.

webservant316’s picture

latest jquery map hilight plug in now available here - https://github.com/kemayo/maphilight. I needed to install this for hilights to work on IE 9 with jq_maphilight 6.x.-1.3