Share Posted August 16, 2017 Is there a way to see what plugins are loaded? For example, I want to be able to detect if CustomEase or ScrollTo is available on a page. Link to comment Share on other sites More sharing options...
Share Posted August 16, 2017 typeof ScrollToPlugin; returns "function" if ScrollToPlugin is available. if(typeof ScrollToPlugin === "function"){ //use ScrollToPlugin } Same can be used for 'CustomEase'. Link to comment Share on other sites More sharing options...
Share Posted August 16, 2017 Hi @Conversant Welcome to the forum. This should work for you: if (window.CustomEase && window.ScrollToPlugin) {} Happy tweening. 1 Link to comment Share on other sites More sharing options...
Share Posted August 16, 2017 In case you need a whole list of them: var plugins = com.greensock.plugins; Object.getOwnPropertyNames(plugins).forEach( function (val, idx) { $("<li>" + val + "</li>").appendTo("ul"); } ); var eases = com.greensock.easing; Object.getOwnPropertyNames(eases).forEach( function (val, idx) { $("<li>" + val + "</li>").appendTo("ul"); } ); See the Pen qXpEdR?editors=1010 by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
Share Posted August 16, 2017 @Carl show off. 3 Link to comment Share on other sites More sharing options...
Share Posted August 16, 2017 Ha, don't worry. I kind of stole this from Jack recently. Overheard it while I was re-doing the bathroom tile 1 Link to comment Share on other sites More sharing options...
Author Share Posted August 16, 2017 Thanks Everyone! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now