Question

I want to create a list that is actually a list of collapsible divs on my site. So when you click on an item on the list, more information will become visible.

I'm using animatedcollapse from http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

The problem is that since I'm looping over divs, they all have the same id, and thus 'opening' any of the divs will open all of the divs.

Should I make unique id's for every div? How is it done?

Thanks a lot for your help. I'm using Django.

Was it helpful?

Solution

id's in an html page should always be unique. When you're looping, you can append the loop index to your id, to make it unique.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top