Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $.fn.flex = function ( options ) {
  2. var p = this.data("flex"),
  3. opts = options || {};
  4. if (p) return p;
  5. this.each(function () {
  6. p = new Flex( this, opts );
  7. $(this).data("flex", p);
  8. });
  9. return opts.api ? p : this;
  10. };
  11.  
  12. <script type="text/javascript">
  13. $(function() {
  14. $(".flex").flex();
  15. });
  16. </script>
  17.  
  18. TypeError: jQuery(...).flex is not a function
  19.  
  20. <script src="/path/to/jquery.js"></script>
  21. <script src="/path/to/the-plugin.js"></script>
  22.  
  23. foo = function () {
  24. // this is a minimal function
  25. };
  26.  
  27. $.fn.flex = function ( options ) {
  28. // ideally some code here
  29. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement