jQuery question #gazillion

Out of context: Reply #4

  • Started
  • Last post
  • 7 Responses
  • redred0

    If I understand your question correctly...

    <a href="#" id="foobar1">Slide 1</a>
    <a href="#" id="foobar2">Slide 2</a>

    /* One function */
    function activateSomeElement() {
    $("#foobar1").addClass("active...
    $("#foobar2").addClass("active...
    }

    /* Two click handlers */
    $("#foobar1").click(function() {
    activateSomeElement();
    });
    $("#foobar2").click(function() {
    activateSomeElement();
    });

View thread