Forums

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

Home Forums CSS Button active state when not leaving the current page?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #34976
    joelmb
    Member

    Hi chaps. My site at http://mediamarble.com uses the marvellous anythingslider for it’s navigation, so all the content lives on the one page.

    I’ve tried both js mouseover and css a :active code to keep the button the user is on active but afaik it isnt possible if you keep the user on the same page? i.e when they click portfolio the slider changes not the page, but i’d like portfolio hover state to remain active. Possible?

    Can anyone instruct me how I can do this?

    #89931
    Arvid
    Member

    I’m not sure if it would work but couldn’t you use use onclick javascript to add the css active class when clicked?

    #89932
    joelmb
    Member

    would you know the code to use for that?

    #89933
    Arvid
    Member

    Sadly only with jQuery:


    $(document).ready (function () {
    $("yourelementhere").click (function () {
    $(this).addClass("yourclass");
    $("otherlinks").removeClass("theactiveclass");
    });
    });

    I hope that might be of some help.

    #89943
    joelmb
    Member

    thanks for that. could you give examples of the syntax to enter in “yourelementhere”, “yourclass” and “otherlinks”?

    #89945

    You can use the :target pseudo-class but it doesn’t work in IE8 or below. See this for more information: http://webdesignernotebook.com/css/the-css3-target-pseudo-class-and-css-animations/

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.