First of all, you should be assigning your content links (the ones on
the left) classes and not IDs.  Not only is it bad practice, but
jQuery will stop after it hits the first one.

Second of all,
$("a").click(function () {
        var filter = $(this).attr("id");
        $("li").not(filter).not(".sourceLink").toggle('slow');
});

This snippet is a terrible performer.  You have several links on that
page, and you are telling jQuery to assign an event to every single
one.  What you should be doing is $("#sources a").

Change your ID's in your list items to classes and something like this
should work (yours doesn't specify the hash symbol, #, before the
"filter", but is faulty anyways as aforementioned)
$("#sources a").click(function () {
        var filter = $(this).attr("class");
        $("#News li").not("."+filter);
});


On Jul 11, 11:22 am, Willie <[EMAIL PROTECTED]> wrote:
> I am building a test site with jquery. The site lists links from
> several rss feeds. On the right side of the page there is a sources
> legend. I would like to be able to click a source and show only links
> from that source while the others hide. Then when I click a different
> source, those links appear, and the others hide.
>
> Each link has a ID of the source that it is associated with. I figured
> it would be easier to toggle them when they had a similar name. I
> can't get a handle on how to pass along what feed (source) I want to
> be visible when a user clicks.
>
> Can you take a look and give me some advice?
>
> http://watercoolertv.com

Reply via email to