Relative Content

Tag Archive for jquerynextuntil

Show div if class exists later before next div of same class

I want the code to go through each div and if it has the class of “type2” or “type3”, then show the div with the class of “itemheader” that is above it. It is not nested, so it’s not a parent/child situation. However this code only shows the “itemheader” div if the first item is “type1” or “type2”. Sometimes there will be multiple instances of “type1” either directly above or below it, or it may not be there at all.

Show div if class exists later before next div of same class

I want the code to go through each div and if it has the class of “type2” or “type3”, then show the div with the class of “itemheader” that is above it. It is not nested, so it’s not a parent/child situation. However this code only shows the “itemheader” div if the first item is “type1” or “type2”. Sometimes there will be multiple instances of “type1” either directly above or below it, or it may not be there at all.

Show div if class exists later before next div of same class

I want the code to go through each div and if it has the class of “type2” or “type3”, then show the div with the class of “itemheader” that is above it. It is not nested, so it’s not a parent/child situation. However this code only shows the “itemheader” div if the first item is “type1” or “type2”. Sometimes there will be multiple instances of “type1” either directly above or below it, or it may not be there at all.

Show div if class exists later before next div of same class

I want the code to go through each div and if it has the class of “type2” or “type3”, then show the div with the class of “itemheader” that is above it. It is not nested, so it’s not a parent/child situation. However this code only shows the “itemheader” div if the first item is “type1” or “type2”. Sometimes there will be multiple instances of “type1” either directly above or below it, or it may not be there at all.