(function($) {
//code here
})(jQuery);
var defaultSettings = { mode : 'Pencil',
lineWidthMin : '0',
lineWidthMax : '10',
lineWidth : '2' };
settings = $.extend({}, defaultSettings, settings || {});
$.fn.wPaint = function(settings) {
return this.each(function() {
var elem = $(this);
//run some code here
}
}
var defaultSettings = {
mode : 'Pencil',
lineWidthMin : '0',
lineWidthMax : '10',
lineWidth : '2' };
settings = $.extend({}, defaultSettings, settings || {});
$.fn.wPaint = function(settings) {
return this.each(function() {
var elem = $(this);
//run some code here
}
}
function Canvas(settings) {
this.settings = settings;
this.draw = false;
this.canvas = null;
this.ctx = null;
return this;
}
Canvas.prototype = {
generate: function() {
//generate code
}
}
Canvas.prototype = {
generate: function() {
//some code
var $this = this;
var buton = //...some code
button.click(function(){
//using this will not be found since it has it's own this
//use $this instead.
$this.someFunc($this);
});
},
someFunc: function($this) {
//won't know what "this" is.
//use $this instead passed from the click event
}
}
function Canvas(settings) {
this.settings = settings;
return this;
}
generate() appendColors() colorSelect() colorHoverOn() colorHoverOff() appendToElement() showPalette() hidePalette()
var lineWidth = $("#container").wPaint("lineWidth");
$("#container").wPaint("lineWidth", "5");
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有