UPDATE I have found out why this isn't working, but don't know the solution.
the problem is that this code just runs on the first matching element (the first div with class "expandCollapse") and then, based on the height of its parent, applies the rest of my code to ALL instances of "div.expandCollapse", rather than calculating the height of EACH div with the correct class, and then applying the necessary action to each, individually. what should i do?! thanks in advance to anybody who can help. Kyle On May 2, 2:39 pm, kyleduncan <kyledun...@hotmail.com> wrote: > Hi, > > i use jQuery 1.3 and would like to make the following code run as soon > as the elements i am targeting have loaded (or as soon as the page has > finished loading). At the moment, I can only get it to fire on an > event related to the target (in code below i'm using "hover"). > > Ihave put this snippet of code inside the document .ready handler, > which is where I assume i should put it (?): > > $('div.expandCollapse').hover(function() { > $(this).parent().css("height","auto"); > var fullHeight = $(this).parent().height(); > if (fullHeight == 77) { > $(this).hide(); > } > $(this).parent().css("height","77px"); > }); > > What i want to happen though, is for this to fire as soon as all of > the divs with class "expandCollapse" have finished loading. even if it > just runs once the page is completely finished loading, that would be > fine, but i dont know what to use. i tried ".load" to replace ".hover" > and got nothing. i've also experimented with bind and trigger to no > avail. > > Any help would be greatly appreciated! > > Kyle