function nameOfFunction () { d3.selectAll(".classOfYourNodes").each( function(d) { d.fixed = true; } ) }
The .each method calls an anonymous function, which in this case sets the fixed attribute to true for each node within the selection.
Edit: The above refers to your comment about wanting to stop all nodes and not have the simulation continue when you drag the node, as the call to force.stop () does.
Walter roman
source share