Simulate :active state?
Simulate :active state?
Straight to the point: I have an absolute positioned element that with a top value of 130px. I also have the following .css code:
- .element:active {top: 131px}
This makes the element move one pixel down when clicked, simulating a button click.
Now, besides clicking this element with the mouse, the user can also use the keyboard. I've managed this with the following code:
- $j(".element").click();
When the user presses the corresponding key, the above code executes. It works wonders and the click function executes as expected, but the :active state on my CSS file does not. Is there any way to make the browser think the element is in it's :active state when executing the jquery code?