Jquery scrolldown css not working

So, after fixing the disappearance problem ( The element disappears when clicked ) I have a new problem, which I think is related to this problem.

When I click the title link, the page scrolls down, with jQuery, to the desired article. This feature works great. But another function changes the css of the corresponding button on the position on the page ( scrolltop()). This feature also works. But when I clicked the button, my css did not change. This makes my button a white link with a gray “clicked” border around it (executed by the browser). Only when I click elsewhere on the screen (to remove the “active” state of the button) does the button change color.

I could not reproduce the problem using JSFiddle ( Fiddle ), so here are some images describing the problem above:

This is my menu:

Normal

This is when I find my menu:

hover

This is when I selected "over ons":

Selecteded

And this is when I remove the button from myself:

Unselected

Now the question arises: how can I give the button you selected (image 3) to the same css as my unselected button (image 4)?

This style text-decoration:nonedoes not work. Also using the :activecss attribute does not work.

I can not find a solution on the Internet. Did I miss something?

Decision

Thanks for this answer! :focusdid the trick. Never heard of this before, but it worked. Thank!

+4
source share
3 answers

CSS :focus, docs.

- :focus :active.

.

+2

noSelect . .

.noSelect {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

Edit ,

a:active {
    outline:none 
} 
0

css :focus . .menuButton:focus, .

- ( ). .

: $(':focus').blur() (JQuery).

Drops :focus.

0

All Articles