how do i add a function i want to use inside another js function belonging to js class ?
function inside function
Collapse
X
-
Sorry I posted that before the explanation. If the functions are in the same class then you should be able to access them by just this.func()Originally posted by oll3ii have a class eg myClass
then i have a function that belongs to that class myClass.prototy pe.display()=fu nction{ here code to display and here i want to use two other functions}
that also belong to the class myClassComment
-
but when i define
i get an error that the Menu is not definedCode:Menu.prototype.changeLinkStyleOn = function(id){ var divId= document.getElementById(id); with (divId.style){ width:7.5em; float:left; display:block; text-align:center; margin:0 1px 0 0; font-size:100%; text-decoration:none; color:#FFF; font-weight:bold; background: url(../images/top_menu_hover.gif) left top no-repeat; } };
and Menu is defined
as
do i add semicolon at the end of the class definitionCode:function Menu(modul,var1,var2,var3,var4,var5,var6,var7,var8,var9,var10,var11,var12,var13,var14,var15) { this.modul=modul; this.var1=var1; this.var2=var2; this.var3=var3; this.var4=var4; this.var5=var5; this.var6=var6; this.var7=var7; this.var8=var8; this.var9=var9; this.var10=var10; this.var11=var11; this.var12=var12; this.var13=var13; this.var14=var14; this.var15=var15; };Comment
-
still the same doesnt see Menu function ? but again when i remove functions
Menu.prototype. changeLinkStyle On = function(id) and Menu.prototype. changeLinkStyle Out= function(id) menu displays
Menu.prototype. changeLinkStyle On = function(id) is defined as follows
i dont know how to camel the "background : url" and if i should?Code:Menu.prototype.changeLinkStyleOn = function(id){ var div= document.getElementById(id); div.style.width:8em; div.style.float:'left'; div.style.display:'block'; div.style.textAlign:'center'; div.style.marginTop:0; div.style.marginRight:0; div.style.marginBottom:0; div.style.marginLeft:0; div.style.fontSize:100%; div.style.textDecoration:'none'; div.style.color:'#FFF'; div.style.fontWeight:'bold'; div.style.background: url(../images/top_menu_hover.gif) left top no-repeat; };Comment
Comment