[jQuery] Re: Refactoring Functions

2008-06-05 Thread Klaus Hartl
PS: The thing is with fixed positioning you get a *much better* experience in browsers that support it, e.g. smoother, no jumping elements/flickering. Using a resize handler is just clumsy. IE6 can be hacked away to support it, see link above. --Klaus On 5 Jun., 08:52, Javier Martínez <[EMAIL

[jQuery] Re: Refactoring Functions

2008-06-05 Thread Klaus Hartl
http://www.howtocreate.co.uk/fixedPosition.html On 5 Jun., 08:52, Javier Martínez <[EMAIL PROTECTED]> wrote: > I think that position:fixed is not supported on IE6. > > Klaus Hartl escribió: > > > On 5 Jun., 06:22, Karl Swedberg <[EMAIL PROTECTED]> wrote: > > >> or this ... > > >> $(document).rea

[jQuery] Re: Refactoring Functions

2008-06-05 Thread Javier Martínez
I think that position:fixed is not supported on IE6. Klaus Hartl escribió: > On 5 Jun., 06:22, Karl Swedberg <[EMAIL PROTECTED]> wrote: > >> or this ... >> >> $(document).ready(function() { >> stickyFooter(); >> >> $(window).resize(stickyFooter); >> >> }); >> > > How about: > >

[jQuery] Re: Refactoring Functions

2008-06-04 Thread Klaus Hartl
On 5 Jun., 06:22, Karl Swedberg <[EMAIL PROTECTED]> wrote: > or this ... > > $(document).ready(function() { >     stickyFooter(); > >     $(window).resize(stickyFooter); > > }); How about: $(function() { $(window).resize(stickyFooter).trigger('resize'); }); You wouldn't need a named functio

[jQuery] Re: Refactoring Functions

2008-06-04 Thread Karl Swedberg
Hi Chris, Looks like the problem lies with the lines where the function is being called. Either put it inside an anonymous function or use a named reference to the function instead. Try something like this. $(document).ready(function() { stickyFooter(); $(window).resize(function() {

[jQuery] Re: Refactoring Functions

2008-06-04 Thread Chris P
> Better yet, change line second line of stickFooter function to: > > var height = $(document).height() - 341; > > And remove the third line entirely. > > Carl Thanks for responding Carl. This is what I ended up using as you prescribed. var stickyFooter = function() { var height =

[jQuery] Re: Refactoring Functions

2008-06-04 Thread Carl Von Stetten
Better yet, change line second line of stickFooter function to: var height = $(document).height() - 341; And remove the third line entirely. Carl Carl Von Stetten wrote: > How about this (untested): > > var stickyFooter = function() { > var height = $(document).height(); > var heig

[jQuery] Re: Refactoring Functions

2008-06-04 Thread Carl Von Stetten
How about this (untested): var stickyFooter = function() { var height = $(document).height(); var height = height - 341; $('#footer').css('margin-top', height); } $(document).ready( stickyFooter(); ); $(window).resize( stickyFooter() ); HTH, Carl Chris P wrote: > I wanted