jquery - D3 select sibling, give it a class -


i have several group elements, siblings.

i'm trying select 1 class of 'sliceactive' , give class of 'slice' , give next sibling down class of 'sliceactive'

enter image description here

all of on click event next button. know how select .activeslice , give .slice how select next g node , give .sliceactive?

       $(".button").click(function(){             d3.select("g.sliceactive").attr('class','slice');         }); 

you can use css adjacent sibling

d3.select("g.sliceactive + g").attr('class','sliceactive'); 

might want check browser support based on particular requirements.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -