Oh thank you SO MUCH , and very sorry to have posted in the wrong spot. Thank you for the nudge, very appreciated.
By the way I do love jquery so thanks for the time spent developing it for the rest of us. On Aug 24, 2:25 pm, lrbabe <lrb...@gmail.com> wrote: > Hello Hassafrass, > > This is the group for questions related to the development of the > library itself rather than how to use it. > You have more chances to get an answer if you post on the appropriate > group:http://groups.google.com/group/jquery-en > > While you are here, and since it's a tricky issue, here are my 2 > cents: > The resize event doesn't behave in the same way in all browsers > As far as I can remember, in IE and Webkit based browsers it fires > multiple time, before and after the actual resize. > Here is the code I've successfully used in the past: > > var resizeTimeout = null; > $(window).resize(function(){ > if (resizeTimeout) > clearTimeout(resizeTimeout); > resizeTimeout = setTimeout(function(){ > // Your code goes here > }, 100); > }); > > The timer is here to make sure that only one of the resize events is > captured and that it is captured after the resize occured. > The 100ms delay should be unnoticeable for your users and effective in > most cases, but might be adjusted if required. > > Regards, > lrbabe > > On Aug 24, 9:50 pm, hassafrass <emma.ir...@gmail.com> wrote: > > > Hi, > > > I am trying to get the new width of a div after window resize. I am > > using: > > > $(window).bind('resize', function() { > > > $myDivWidth = $('.mydiv').width(); > > > } > > > but I am finding that the value is of the size BEFORE resize, rather > > than after. $(window).ready(function() doesn't fire on resize, so > > how can I get the width after resize? > > > Thank you --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---