jQuery 1.9 was released recently, and removed some things that have long been labeled as deprecated. This broke maphilight slightly, since it was still doing a few checks on $.browser
.
I’ve just fixed that. As always, the latest version is available on github.
Hi.
I found a bug:
The original image size is w:1000 and h:626.
The html code:
//Resize
If the the original image width and height is 550 and 344, than works fine.
But if they are different does not change the size of the image.
If i supplements the javascript code:
wrap = $(‘
‘).css({
display:’block’,
background:’url(“‘+this.src+'”)’,
‘background-size’:this.width+”px “+this.height+”px”, //<--NEW CODE
position:’relative’,
padding:0,
width:this.width,
height:this.height
});
Then works fine in FF, but IE 8 dosent works. Dont resized the image.
Do you have any idea?
I solved the problem:
if (has_canvas) { //FF and others
wrap = $(‘
‘).css({
display:’block’,
background:’url(“‘+this.src+'”)’,
‘background-size’:this.width+”px “+this.height+”px”,
position:’relative’,
padding:0,
width:this.width,
height:this.height
});
} else {//IE
wrap = $(‘
‘).css({
display:’block’,
“filter”: “progid:DXImageTransform.Microsoft.AlphaImageLoader(src='”+this.src+”‘, sizingMethod=’scale’)”,
“-ms-filter” : “progid:DXImageTransform.Microsoft.AlphaImageLoader(src='”+this.src+”‘, sizingMethod=’scale’)”,
position:’relative’,
padding:0,
width:this.width,
height:this.height
});
}
@Kis Viktor that is great fix. Thanks!
awesome jquery, its very helpfull, tnx!
and tnx for the fix too!!! ^^
Thank you so much for creating this Library and for fixing the bug. I had folk telling me it was broken, but it was only a little IE9 bug (and I’m on 10). I love it. š
It looks great on our geological walk! http://www.bgs.ac.uk/contacts/…
Added a few features to it on Github that I needed, one of which is a bugfix for a dealbreaker if you use Maphilight with resized images on your website.