Join the Conversation

6 Comments

  1. 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?

  2. 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
    });
    }

  3. 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/

  4. 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.

Leave a comment

Your email address will not be published. Required fields are marked *