Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Yes, if you are using it in an html file. If you are using it in Lightning Components, you can either use the lightning:overlayLibrary or write the markup as above and use $A.util.removeClass/$A.util.addClass methods instead of jQuery. Let me know if that answers your question.