LM35DT
LM35DT

Reputation: 13

jQuery resize width on firefox

I'm doing some experiments with jquery n widths for a liquid column and I'm not sure why it isn't working on firefox. It works fine on IE6,7,8 Chrome, Opera(sluggish). I found some articles about firefox not recognizing the .resize attribute but no explanation/solution =\

$(document).ready(function(){
$(midCol).width((window,$(window).width()) - 470)
 $(window).resize(function(){$(midCol).width((window,$(window).width()) - 470)
})
});

Upvotes: 1

Views: 3134

Answers (1)

wsanville
wsanville

Reputation: 37516

Update: Your problem is with your selector, simply change it to $('#midCol') to get the desired effect:

$(document).ready(function(){
    $('#midCol').width($(window).width() - 470)
    $(window).resize(function() {
        $('#midCol').width($(window).width() - 470)
    })
}); 

What version of Firefox are you using? I can't seem to reproduce resize() not working in Firefox (3.6.3). I suggest trying a simple demo page for the resize method and see if you're still having problems. If this example works, then your problem likely lies elsewhere and you'll need to include some more info.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $(window).resize(function() {
                $('#log').append('<div>Handler for .resize() called.</div>');
            });
        });
    </script>
</head>
<body>
    <div id="log"></div>
</body>
</html>

Upvotes: 1

Related Questions