- This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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?
I’m not sure if it would work but couldn’t you use use onclick javascript to add the css active class when clicked?
would you know the code to use for that?
Sadly only with jQuery:
$(document).ready (function () {
$("yourelementhere").click (function () {
$(this).addClass("yourclass");
$("otherlinks").removeClass("theactiveclass");
});
});
I hope that might be of some help.
thanks for that. could you give examples of the syntax to enter in “yourelementhere”, “yourclass” and “otherlinks”?
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/