javascript - creating new property - JS / Edge Animate -


i trying create property of object can access function. i've been trying figure out dot / bracket notation i'm not getting it. 1 of please me figure how make objects state readable function.

function twophaseswitch(object,state) {     var obj = $(object);     stage.getsymbol(obj).stop(state);      obj.click(function(e)     {         if(obj.state == 'off')         {             stage.getsymbol(obj).stop('on');             obj.state = 'on';         }else{             stage.getsymbol(obj).stop('off');             obj.state = 'off';         };     }); };  function conditionsarray(obj) {     (var i=obj.length;i--;)     {         alert(obj[i].state);     }; }; 

i'm not sure if correct answer works. ended using jquery's .data() call.

//in switch function obj.data('state',state);  //in conditionarray alert($(obj[i]).data('state')); 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -