0

I've built this website relying heavily on JQuery, and have run into an issue with IE.

When you click this icon:

enter image description here

There's a custom lightbox that comes down and loads an iframe holding a form. It works fine in Chrome/FF, but in IE it says there's an error:

enter image description here

I've purposely used the non-minified version of JQuery to work out which is the line of code in question, which appears to be:

fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;

Additionally, this is what I've written to create the lightbox effect:

function popup(url, width, height)
{
    var shell = $('<div id="popup-shell"></div>');
    shell.append('<div style="margin-top: -' + height + 'px; width: ' + width + 'px; height: ' + height + 'px;" id="popup-inner"></div>');

    var inner = shell.find("div#popup-inner");

    var cb = $('<a style="margin-left: ' + Number(width - 26) + 'px;" id="popup-close"></a>');

    inner.append(cb);
    inner.append('<iframe width="' + width + '" height="' + height + '" src="' + url + '" scrolling="no" frameborder="0"></iframe>');

    cb.click(function()
    {
        shell.stop().animate({height: "0%"}, 700, 0, function()
        {
            shell.remove();
        });
    });

    shell.animate({height: "100%"}, 700, 0, function()
    {
        inner.animate({marginTop: "120px"}, 700);
    });

    $("body").append(shell);
}

If this is a known problem, any suggestions or solutions would be great.

1 Answer 1

1

Append the shell object to body first

$("body").append(shell);

then add the animation script

shell.animate({height: "100%"}, 700, 0, function()
    {
        inner.animate({marginTop: "120px"}, 700);
    });

That should solve your problem. I did test it in IE console mode and it worked

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.