0

As explained for example here, jQuery UI defines CSS classes like .ui-state-active (which are applied through JS), instead of using the existing CSS pseudo-classes, e.g. :active. Why?

1
  • Possibly because :active is not fully supported in older versions of IE - remember that jQuery's primary purpose is to bridge compatibility problems. Commented Mar 17, 2014 at 10:52

2 Answers 2

1

I stumbled upon this recently, I found:

:active is mostly used for and implemented by different browsers for

<a> and <button>.

jQuery UI defines classes like .ui-state-active so that it can be easily applied to:

<ul>, <span>, <li>, <div>

As most of the jQuery UI elements are build up of these.

https://developer.mozilla.org/en-US/docs/Web/CSS/:active

Sign up to request clarification or add additional context in comments.

Comments

1

Like Niet the Dark Absol said, the added class allows support for non HTML5 browsers like IE8 and below

http://api.jquery.com/category/version/1.7/

Better Support for HTML5 in IE6/7/8

According to can I use.com, iOS Safari and android doesn't support pseudo selectors either - So the added class allows browser compatibility for those devices

http://caniuse.com/#search=pseudo

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.