jquery-bootsoedit.js 704 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /**
  2. 双击编辑格
  3. */
  4. (function ($) {
  5. function bootsoedit(element, options){
  6. var obj = element;
  7. var can = options;
  8. var rand = js.getrand();
  9. var me = this;
  10. this.init = function(){
  11. obj[can.trigger](function(event){
  12. me.setcontent(this, event);
  13. });
  14. };
  15. this.setcontent = function(o1, e){
  16. alert(1);
  17. }
  18. };
  19. $.fn.bootsoedit = function(options){
  20. var defaultVal = {
  21. trigger:'click',
  22. fields:'',
  23. data:[],//当前数据
  24. title:''
  25. };
  26. return this.each(function(){
  27. var can = $.extend({}, defaultVal, options);
  28. var clsa = new bootsoedit($(this), can);
  29. clsa.init();
  30. return clsa;
  31. });
  32. };
  33. })(jQuery);