# Looping through divs in a master div to set opacity

**URL:** <https://forum.kirupa.com/t/looping-through-divs-in-a-master-div-to-set-opacity/282027>\
**Category:** Uncategorized\
**Created:** [February 16, 2009, 10:37pm UTC](https://forum.kirupa.com/t/looping-through-divs-in-a-master-div-to-set-opacity/282027 "2009-02-16T22:37:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andriusain](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@andriusain](https://forum.kirupa.com/u/andriusain)\
**Post date:** [February 16, 2009, 10:37pm UTC](https://forum.kirupa.com/t/looping-through-divs-in-a-master-div-to-set-opacity/282027/1 "2009-02-16T22:37:45Z")

</div>

Hello all. I’m not at all versed with javascrip but since is quite similar to AS3, which I have been learning for the last three months I have an understanding of how it works.

I need your help with the following: I have around thirty divs inside a master div. These divs contain each one a dot image of a dotted line. I want to create an animation with this dots so each one will set its opacity from 0 to 1 a tenth of a second one after the other. I know this should be very simple to do with a loop but I don’t know how to loop through the divs inside a master div.

I have a few lines of code from jquery to set opacity but other than that I dont know what to do.

```auto
    $(document).ready(function(){
                        
        $(".div1").animate({opacity: "-400"}, 1)
        .animate({opacity: "0.01"}, 1000)
        .animate({opacity: "1"}, 2000)
    });

```

Any help would be, as always, really appreciated.

Thanks Kirupians!
