Search Results

Search found 1 results on 1 pages for 'invidian'.

Page 1/1 | 1 

  • How to run Jquery constructor from own function?

    - by Invidian
    I need to create a function which will returning jQuery.Color object and i have no idea how to do it. Here is code example function newcolor () { var obj = new $.Color( 'rgb(0,0,0)' ); return obj;} var foo = newcolor(); foo.red(); Edit: My full code: function my (element,a,b,c){ //class my this.target = $(elem); this.new_color = function (a,b,c) { return new $.Color( 'rgb('+a+','+b+','+c+')'); } this.base_color = new_color (a,b,c); this.colorize = function () ( this.target.css({ background-color: new_color }); } var div = new My($('foo'),0,0,0); div.new_color(255,255,255); div.colorize(); My goal is to create class which can hold jquery element and operate on it. Now I'm stuck on returning $.Color().

    Read the article

1