Skip to content

Instantly share code, notes, and snippets.

@surjithctly
Created July 21, 2017 13:15
Show Gist options
  • Save surjithctly/3d5ab82e95613247cc80e4993e91c5c9 to your computer and use it in GitHub Desktop.
Save surjithctly/3d5ab82e95613247cc80e4993e91c5c9 to your computer and use it in GitHub Desktop.
jQuery - Run only if Plugin Exists and the Element is found. Else Skip
// Cache class name
var $element = $('.element');
if ($element.length && $.fn.functionname) {
// Do awesome Stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment