Webanizr Logo
Open / sluit menu
Module forEach

The forEach module loops through a DOM node list and sends eacht element to a callback function.


webanizr.collect('forEach', parameters, callback)


The forEach module accepts the following parameters:

query__selector (required)

The query that selects the nodes over which should be iterated.

miliseconds__interval (optional)

The time between each consecutive call in miliseconds. 


This callback function is called for each element seperatly. If the parameter miliseconds__interval is used, the call is delayed for each next node.

The callback function is call with the data { next__node : element }, where element is the next node from the selection.