Click here to Skip to main content
15,888,280 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
hello friends... i have one question...
when i run my code then only animation is not working...

my code is..

C#
$(document).ready(function () {
    $('.btn').toggle(function () {
      $(".mydiv").animate({ height:"100%" });
    },
    function () {
        $(".mydiv").animate({ height: 50 });
    });
});



and my div code is...
XML
 <div class="btn">
        Header 1</div>
    <div class="mydiv">
This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
        This is the content for the first header.<br />
    </div>
  </div>



please give me a solution...
Thanks in advance...
Posted
Comments
vinay.tatipamula 5-Sep-13 5:31am    
Please be more clear on the question?
[no name] 5-Sep-13 5:32am    
What kind of animation you are trying..?
jkpatelce 5-Sep-13 5:43am    
slideup and slidedown perform when i click on "Header 1".
first time when i click on "Header 1" then height of div box is set to 50px.
and second time click on "Header 1" then height of div box is set to auto.
whole part is working well but animation is not working during processing.

1 solution

This will help You


http://api.jquery.com/animate/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900