thank you, it work
but now i have another problem:

.selected {
display: list-item;
}

and fideIn() don't work

There for I make some changes and all work:
-------------------------- html file:
<ul class="class1">
<li class="selected">List 1 Item 1</li>
<li>List 1 Item 2</li>
<li>List 1 Item 3</li>
</ul>
<p>*****</p>
<ul class="class2">
<li class="selected">List 3 Item 1</li>
<li>List 3 Item 2</li>
<li>List 3 Item 3</li>
</ul>
<p>*****</p>
<ul class="class1">
<li class="selected">List 2 Item 1</li>
<li>List 2 Item 2</li>
<li>List 2 Item 3</li>
</ul>
<p>*****</p>
<ul class="class1">
<li class="selected">List 3 Item 1</li>
<li>List 3 Item 2</li>
<li>List 3 Item 3</li>
</ul>

<p><a href="#" onclick="setUserType(0); return false;">show 1</a></p>
<p><a href="#" onclick="setUserType(1); return false;">show 2</a></p>
<p><a href="#" onclick="setUserType(2); return false;">show 3</a></p>

-------------------------- css file:
ul.class1 li {
        display: none;
}

ul.class1 li.selected {
        display: list-item;
}

ul.class1 li.preselected {
        display: none;
}

-------------------------- script:
$(document).ready(function(){
  setUserType = function(n) {
    var bex = false;
    $("ul.class1 li.selected").fadeOut("slow", function () {
      if( bex ) return;
      bex = true; // stop function executes after each fideOut()
      $("ul.class1 li").removeClass("selected");
      $("li:eq("+n+")" , "ul.class1").addClass("preselected");
      $("li.preselected").fadeIn("slow", function () {
          $
("li.preselected").addClass("selected").removeClass("preselected");
      });
    });
  };
});

and I cen add one variable like "bex" in fideIn() function.

Thank you for help.

Reply via email to