jayapalchandran
07-05-2010, 08:14 AM
function note(x,y,who)
{
this.x = x
this.y = y
this.who = who
this.timeout = null
}
note.prototype.show()
{
$('#notex').fadeIn(200, function() { alert(this.x); }
this.timeout = SetTimtout( function() { alert(this.who); } );
}
var sa = new note(50,50,'notex')
sa.show();
I am trying to create a simple class in which i want to sent the id of a div to fade in and fade out...
so that i can dynamically change its color width and height with a basic class.
I read about closures but inside jquery this is referring the div notex....
how to access parent functions variables?
{
this.x = x
this.y = y
this.who = who
this.timeout = null
}
note.prototype.show()
{
$('#notex').fadeIn(200, function() { alert(this.x); }
this.timeout = SetTimtout( function() { alert(this.who); } );
}
var sa = new note(50,50,'notex')
sa.show();
I am trying to create a simple class in which i want to sent the id of a div to fade in and fade out...
so that i can dynamically change its color width and height with a basic class.
I read about closures but inside jquery this is referring the div notex....
how to access parent functions variables?