Thanks for the code samples Carl. I did try to save the index, but must have been doing something wrong. I'm glad to have a code sample to go by.
Cheers, Marty On Feb 17, 1:53 pm, Karl Swedberg <k...@englishrules.com> wrote: > you could store the link's index: > > $('#yourlist a').each(function(index) { > $(this).click(function() { > $.cookie('mylink', index); > // do something else? > /* (?) */ return false; > }); > > }); > > Then, you can select it like this: > if ( $.cookie('mylink') != null ) { > $('#yourlist a:eq(' + $.cookie('mylink') + ')') > // .doSomething(); > > } > > --Karl > > ____________ > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Feb 16, 2009, at 10:14 PM, junk.mail...@gmail.com wrote: > > > > > I need to save state for a nav in a cookie. I've managed to learn > > enough jquery so far to be able to detect which link was clicked and > > traverse to the dom element that I want save a pointer to, I'm just > > not sure what value to store in the cookie so I can identify that > > element on the next page load. The li elements in question don't have > > an assigned id or class, so I'm not sure what handle to the element I > > can store to get back to it. > > > If my description of the problem isn't clear enough, please let me > > know and I'll try to clear it up in any way necessary. > > > Thanks, > > Marty