afsarwebdev

Js if function exist then execute the code

May 23rd, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. if ($.fn.functioname) {
  2. //Your code here
  3. }
  4.  
  5. //Example
  6. if ($.fn.countdown) {
  7. $('#ic-countdown').countdown('2019/01/01', function(event) {
  8. $(this).html(event.strftime(
  9. '<span class="ic-time"><span>%d</span> <span>days</span></span> <span class="ic-time"><span>%H</span> <span>hours</span></span> <span class="ic-time"><span>%M</span> <span>minutes</span></span> <span class="ic-time"><span>%S</span> <span>seconds</span></span>'
  10. ));
  11. });
  12. }
Advertisement
Add Comment
Please, Sign In to add comment