Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working in IE7 #55

Closed
gmasi26 opened this issue Apr 19, 2012 · 6 comments
Closed

Not working in IE7 #55

gmasi26 opened this issue Apr 19, 2012 · 6 comments
Labels

Comments

@gmasi26
Copy link

gmasi26 commented Apr 19, 2012

Hi,
I installed the script (latest version 1.2.4.065) on a Wordpress website and it seems working fine on all browser except IE7 where it doesn't work at all...

@gmasi26
Copy link
Author

gmasi26 commented Apr 19, 2012

This is the script loaded in the footer of the page together with the imagemapster.js:
map = jQuery('#hacienda');
map.mapster({
fade: true,
fadeDuration: 50,
fadeInterval: 50,
fillOpacity: 0.4,
render_highlight: {
fillColor: 'FFFFFF',
stroke: false,
},
render_select: {
fill: false,
stroke: true,
strokeColor: 'FFFFFF',
strokeOpacity: 1,
strokeWidth: 2,
},
mapKey: 'id',
mapValue: 'title',
isSelectable: true,
isDeselectable:false,
singleSelect:true,
onClick: function (data) {
title = jQuery(this).attr('id');
sel = jQuery('#info-box-'+title).hasClass('deselected');
if (sel) {
jQuery('.selected').removeClass('selected').addClass('deselected');
jQuery('.item-selected').removeClass('item-selected').addClass('item-deselected');
jQuery('#info-box-'+title).removeClass('deselected').addClass('selected');
jQuery('#item-'+title).removeClass('item-deselected').addClass('item-selected');
jQuery('.deselected').fadeOut('slow', function() { jQuery('.selected').fadeIn('slow') } );
}
},
});

@jamietre
Copy link
Owner

You have trailing commas:

stroke: false,  }

Make sure the javascript is valid & try again. IE and other browsers handle trailing commas in arrays an object defs differently.

For a discussion:

http://www.enterprisedojo.com/2010/12/19/beware-the-trailing-comma-of-death/

@gmasi26
Copy link
Author

gmasi26 commented Apr 19, 2012

Thanks! That helped!

However, since I updated to the latest version of the imagemapster script, IE7 and IE8 don't properly render the opacity setup for the areas: fillOpacity 0.4 looks like 0.1!

@jamietre
Copy link
Owner

Yeah there is something wrong with opacity in older IE versions that I actually introduced while trying to fix fading in IE8. I should be able to fix it today or tomorrow. You can get around it by using different options for IE <7 e.g.

var oldIE  = $.browser.msie && ($.browser.version < 9);
opts = {
    mapKey: "mykey",
    fillOpacity: oldIE ? 1 : 0.5
 }

or something like that.

@gmasi26
Copy link
Author

gmasi26 commented Apr 19, 2012

Thanks!

@jamietre
Copy link
Owner

This issue was corrected in 1.2.4.066.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants