Issue
I am thinking of an alternative to JavaScript in case it's manually disabled by the user, so that instead of prompting them to enabled it, I could, for instance, in some way simulate the click event and change, for instance, the background colour by creating my own :click pseudo-class, just like it works for :hover.
Is such a scenario possible? Is it possible for one to create their own css pseudo-classes that?
Solution
If your question is, can I create a custom pseudo, example;
div:my-custom-pseudo { }
Then not without some JavaScript libraries.
Tutorial on using it with mooTools and slick
Personally, I haven't used this, so I don't know browser support and this is pretty much the only resource I ever found on custom pseudo classes.
Edit:
So pretty much, no, you can't do what you want, as you will always need JavaScript to do what you want.
Answered By - Mark
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.