I've written a little script that helps IE to correctly size a couple divs
based on the size of the window. I need this script to run when the document
loads, and anytime the window is resized (and I'll probably later need to
run it when a certain event happens)... so I probably need to give this a
name, and call it by name...
and that's where I keep stumbling.

beginner's question: how do I name this function?

What I've currently got is not right but good enough to know the basic idea
works: 

$().ready(function(){
                if($.browser.msie){ 
                        $(window).resize(function() { 
                                var ww = $(window).width();              
                                var wh = $(window).height();              
                                var pt = $('#rightPane').offset().top;          
                                var dw = $('#leftPane').outerWidth();     
                                $('#leftPane').css('height', (wh - pt - 10) + 
'px');                    
$('#rightPane').css('height', (wh - pt - 10) + 'px'); 
                                $('#rightPane').css('width', (ww - dw - 30) + 
'px');                    });
                };
});     

you can see the page here: 
http://www.monkeypuzzle.net/testfiles/jquery/leftRight/

in IE, if you resize the window, the script will kick in. FF & Safari will
work fine without the script. I know the resize shouldn't be in the
function...

thanks again!

-- 
View this message in context: 
http://www.nabble.com/help-with-syntax%2C-naming-a-function-tf3409727.html#a9499384
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to