javascript - prototype js invoke with custom function -
I have an array of div names, from which I want to switch to loading.
I read from both Prototype API and another website which usually likes if anyone has to do the same thing for each item from the list.
// I have this switch_off function function switch_off (div) {Effect.SwitchOff (div)}; } // And this array div_names = ['notice', 'status_bar', 'word_count'] // Please tell me that this is not the best option: div_names.invoke ('switch_off');
But it does not work.
Do I need a second parameter that I want to ask? Can it be this
?
Added: Here is the firebug output
// value [method] is undefined // [break this error] return value [method] .apply (value, Args);
Thanks!
the effect of the invention
to unlimited
each The item has to call a member method and as you are not suitable for that type of result, unless you want to extend the prototype of the string.
Some work should be provided to do any of the following:
function switch_off (div) {Effect.SwitchOff (div); } // and this array div_names = ['notice', 'status_bar', 'word_count']; // Please tell me that this is not the best choice: div_names.each (switch_off);
or
['notice', 'status-bar', 'wordmount']. Each (function (div) {Effect.SwitchOff (div);});
Comments
Post a Comment