[jQuery] - help with scroll function
Hi, maybe is a javascript problem,
<span style="font-weight: bold;">the code:</span>
var toggleContent = {
cel : null,
doIt : function (el)
{
if (this.cel) {
$('#' + this.cel).slideUp('slow');
}
if (el != this.cel) {
this.cel = el;
$('#' + this.cel).slideDown('slow', function(cel){ alert(this.cel); $('#h_' + this.cel).ScrollTo(1500); });
} else {
this.cel = null;
}
return false;
}
}
<span style="font-weight: bold;">the question:</span>
in the line: " $('#' + this.cel).slideDown('slow', function(cel){ alert(this.cel); $('#h_' + this.cel).ScrollTo(1500); }); " :
<span style="font-weight: bold;">how could access the var this.cel? </span>
when im trying of access this var i get the "undefined" value.. i think this is happend because the function is inside of the another function.. how could access a variable if this is outside of the parent function? exist something like this? "_parent.var" ?
thnx for the help.
PD> greetings from mexico ;)
--
David J. Gutierrez C.
<<a href="http://www.davidjgc.com">www.davidjgc.com</a><
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/