+ Reply to Thread
Results 1 to 2 of 2

Thread: Jquery animate() class

  1. #1

    Jquery animate() class

    Hello , i am using the jquery animate() class and i have a problem which is : I am trying to accomplish a simple box selection and indicate which one is clicked , so far i used that code :
    Code:
    $(".features").click(function(){
        $(".pBox").css("border-color","#ccc");
        $(this).parent().parent().css("border-color","#cc0000");
        $(this).parent().parent().animate({
            height: "20%"
        });
    });
    Please correct me if i have anything wrong .

  2. #2
    joey
    Guest
    Try this and good luck :
    Code:
    $(".features").click(function(){
        $(".pBox").css("border-color","#ccc");
        var $parent = $(this).parent().parent();
        $parent
        .css("border-color","#cc0000");
        .animate({
            height: ($parent.height() + (0.1 * $parent.height()))
        });
    });

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts