$(document).ready(function(){ $('li a').click(function(){ //get all <a>s inside the <li>s $(this).attr('href') //do something, get the images etc. });
}); calling click for multiple elements is the same as calling $('li a').each(function(){ $(this).bind('click', ...) .... On Dec 29, 5:07 pm, yvonney <yvonn...@gmail.com> wrote: > OK... I'm flying fairly blind though I'm enjoying it! > > 1) I guess that the scrollto stuff I'm doing is irrelevant. > > 2)The menu items each have a different #. There's nothing in the html > other than the following example. (except for a jpg call or an > alt=) Each pair surrounded by unique UL # of course.... The > scrollto and localscroll stuff is all in the js and css. right?:-) > > <li><a href="#first-a"></a></li> > <li><a href="#first-b"></a></li> > > <li><a href="#second-a"></a></li> > <li><a href="#second-c"></a></li> > > <li><a href="#third-a"></a></li> > <li><a href="#third-b"></a></li> > > 3) So, I was hoping that I could add an onclick or bind or whatever to > each li only. And then I could have what's already happening just > continue. (localscroll/scrollto etc.) WITH the addition of being able > to have a new swf/jpeg/whatever appear and play/show in a totally > seperate DIV. (I believe this is a different subject somewhat so > initially I guess having a jpg show up in the seperate div and then be > totally REPLACED by another one when I click on a different menu li > would be a good start. > > Right now I'm just fumbling towards adding the onclick/bind. Would it > be possible to get an example of what I'd add to the li's...and maybe > how and where the JQ code would go and look like? > > I also read about the jjquery.listen plugin. Don't know at all if that > would be useful. > > This is SO important right now for me. Very grateful for pointers...!