I have a WebView displaying a HTML page, linking to a CSS file.
The CSS file makes use of the pseudoclasses :active and :hover for rollover effects.
Q. How can I tell, in my WebView, when :active and :hover have been called? I would like to intercept these calls and act on them programmatically within Cocoa.
Thanks.
:active and :hover aren’t calls; they’re CSS pseudo-classes, for use in CSS selectors. You use them in CSS to select elements to style. They’re adjectives, not verbs.
Try adding JavaScript event handlers to the elements instead. You can use a WebScriptObject to project some of your Cocoa methods into the JavaScript space for use from the event handlers.