开发者

Reset Jquery animated elements. Help please?

$(document).开发者_JS百科ready(function(){   
  $("li.playerContainer").click(function(){
    $(this).animate({paddingBottom:"150px", paddingTop:"150px", paddingRight:"230px", marginTop: "-150px", queue:true});
    $("p").animate({opacity:1},2500);
  });

  $(".go").click(function(){
    $(this).parent().parent().animate({queue:true, paddingBottom:"0", paddingTop:"0", paddingRight:"0", marginTop: "0"});
    $("p").hide();
    return false;
  });
});

I am trying to use .animate to expand an li element in unordered list. I have successfully expand and close every each of them. What I need help on is that I want to close the one that already opened when i click another to open, and without close the opened one first. So only one in about ten li element can be opened.

Sorry i am very new to jquery, and i am stuck on this problem. Please help!!


I'm not totally clear on what you're trying to do, but take a look at this and tell me if that's the effect you're going for: http://jsfiddle.net/xyaAE/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜