$("ul li a").click(function() {
$(this).parent().parent().find(".active").removeClass("active");
$(this).addClass("active");
});
On Fri, Jan 30, 2009 at 3:07 AM, Pedram <pedramphp@gmail.com> wrote:
Dear Karl ,
I know You are Expert in these Issues do you have any idea for me
Thanks
On Jan 29, 5:44 pm, Pedram <pedram...@gmail.com> wrote:
> Hi Folks ,
> I have some links in my Navigation bar such as below , I Used FIND
> in my code , does anyone has any better solution for me ,
> I also used Event Delegation in the system .
>
> <ul>
> <li><a href="#" class="active>a</a></li>
> <li><a href="#">b</a></li>
> <li><a href="#">c</a></li>
> <li><a href="#">d</a></li>
> </ul>
>
> $("ul").bind("click",function(e){
> var clicked=$(e.target);
> $(this).find("a.active").removeClass("active");
> clicked.addClass("active");
> });
No comments:
Post a Comment