Skip to content
Advertisement

How can I make this javascript apply on every div returned by jinja

I have a Jinja tag that returns some database data. I added some javascript that works on some divs inside the for tag. The javascript code applies only on the first div.

I am using fullPage.js in order to make full page scroll.

How can I solve this?

html:

JavaScript

js:

JavaScript

Here is the css for fullPage.js:

JavaScript

I am a begginer and I find it easier to use inline css. Thanks for any help!

Advertisement

Answer

That js is hitting the id=’o2′ and being done with it, without unique id’s it won’t reach those next divs, you could fix this by making the id=”o2{{i}} where i is the increment of that wyr loop and add logic to the rest of your code.

Advertisement