hi guys,
I have my object defined as follows:
function KoolTabs() {
this.targetName = "";
this.activeNode = 1;
this.init = function()
{
this.targetName = arguments[0];
this.activeNode = (arguments[1] || 1);
this.setEle( this.activeNode );
this.findNodes();
}
this.findNodes = function()
{
for (i=0;i<document.links.length;i++) {
myEle = document.links[i];
x = document.links[i].href;
if (x.indexOf("#" + this.targetName) >= 0) {
myEle.addEventListener('click', this.onClick, false);
}
}
}
this.onClick = function()
{
alert('Hello ' + this.activeNode);
}
};
I am calling it like:
<script>
var StockTabs = new KoolTabs;
StockTabs.init('tabsStock', 1);
</script>
Now when i click on the object which has the method bing it says "Hello undefined"
how can i get the value of parent object activeNode?