IE issue with custom jQuery extender
<p>My code works with the newest versions of Chrome and Firefox, but doesn't work with IE9,( I don't have earlier versions to test yet).</p>

<p>Here is my jQuery extender</p>

<pre><code>(function ($) {
    $.fn.myModal = function() {

        var offsetx = this.width() / 2;
        var offsety = this.height() / 2;
        var bg = $("&lt;div id='modal-overlay'&gt;&lt;/div&gt;");
        $("body").append(bg);
        //etc.....                  
    }
}) ( jQuery );
</code></pre>

<p>I used a try/catch block to determine which lines of code is throwing an error and it appears that any reference to <code>this</code> is the problem. Even if I wrap <code>this</code> with <code>$(this)</code> it still doesn't work.</p>

<p>Btw I'm calling this extender like so:</p>

<pre><code>$(function ()
{
    $("#login").click(function ()
    {
        $("#login-modal").myModal();
    });

});
</code></pre>

<p>For what it's worth all of this code is in an external file which gets called in the <code>head</code> of the document.</p>
