On Jul 16, 2008, at 6:03 PM, psdp wrote:


I have a value stored in an object, and now i want to pass it to a
jquery function, please help:
var obj = {
   width: 300,
  div: 'testdiv',
   func: function () {
     var newwidth = this.width;
    $('#'+this.div).animate({width:newwidth+'px'}, 1000);
  }
}

sort of looks like you're doing that already?

after your object, call the function:

obj.func();

you should also put a semicolon after the last curly brace, just to be safe.

--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

Reply via email to