try $('#calendar div:lt(10)').hide().remove(); coz hide() doesn't mean to remove(). and you are just repeating the hide action.
On Feb 17, 7:27 pm, "Michael Ray" <[EMAIL PROTECTED]> wrote: > So I discovered the nth-child selector, and ere is what i came up with: > J('#nextButton').click(function () { > J('#calendar > div:nth-child(1)').hide(); > J('#calendar > div:nth-child(2)').hide(); > J('#calendar > div:nth-child(3)').hide(); > J('#calendar > div:nth-child(4)').hide(); > J('#calendar > div:nth-child(5)').hide(); > J('#calendar > div:nth-child(6)').hide(); > J('#calendar > div:nth-child(7)').hide(); > return false; > > }); > > However, This click event will only work once. How can I get it to work > every time? > > On Feb 17, 2008 11:22 AM, Michael Ray <[EMAIL PROTECTED]> wrote: > > > I have made a calendar, whose HTML looks like this > > <div id="calendar"> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > <div>data for that day</div> > > etc..... > > </div> > > > All of the widths and heights are fixed so that the child divs are 7 > > across and 5 down. I want to be able to cycle through the calendar 1 week at > > a time, and I think I have already figured out a way to prepend seven divs > > in the beginning of #calendar, but I in turn want a function that will be > > able to delete the first 7 divs inside the calendar. Does anyone know how > > this could be done? > > > $(#nextButton).click(function(){ > > $("????????????").hide("slow"); > > });