Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery address plugin: issue with active state

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #37685
    mikes02
    Participant

    I cannot get it to apply the active class when the link is clicked on, what could I be doing wrong?

    Here is my HTML:

    And here is my JS

    $.address.init(function()
    {
    $('#slides a').address();
    }).change(function()
    {
    $('#slides a').click(function()
    {
    var address = $.address.value($('#slides a').attr('href'));
    alert(address);

    if($(this).attr('href') == address)
    {
    $(this).addClass('active');
    } else {
    $(this).removeClass('active');
    }
    });
    });

    also it is returning [object Object] / undefined for the alert….

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.