-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Hover Effects with pseudo class :active or on click #63
Comments
Unfortunately, There are a few CSS-only hacks to trigger animations that bypass JavaScript (using Hover.cssIn hover.css, comment out the
JavaScriptAttach the click event listener to the element: document.getElementById("my-button").addEventListener("click", clickButton, false); Define the click function that will trigger (toggle) the function clickButton() {
var that = this;
this.classList.remove("hvr-push-click");
setTimeout(function() { that.classList.add("hvr-push-click"); }, 0);
} HTMLMake sure to give the element the regular (not click) |
So would this be the way to assign the same css styles used for the hover effect to the selected menu item when the item selected for a nav menu? For example. I am using the hvr-underline-from-center effect and renamed them to .menu-item class, and would like the same underline style to be the static style for the .current-menu-item class. |
Hi, how couId I apply hover effects when it's clicked some div has some class hover.css, I tried copy the css rules and added the pseudo class :active but it didn't work, Thanks
The text was updated successfully, but these errors were encountered: