showing and hiding div

showing and hiding div

Hello guys, i have this code:
if($title.children('div:eq(' + i + ')').not(':visible')){
                                    //$title.children('div:eq(' + i + ')').css('display','inline-block');
                                    $('div.room-ages-titles').children('div:eq('+ i +')').css('display','inline-block');
                                }

What it does, is when i select option 1 of a dropdown list it shows shomething like this:

ch#1

if 2:

chd#1      ch#2

if 3:
ch#1      ch#2      ch#3

But now i want to hide them one by one. if i go from 3 to 2, i hide one element, and so on with the other ones.


Thanks in advance.