Solved

so why jquery animate function does not working?

Posted on 2010-11-20
4
866 Views
Last Modified: 2012-05-10
hi,

I have 2 divs, first one is 550px and the second one is 289px, the second one is inside the first one, I wanna animate the height of the first one to 289px, but that doesnt work!

so why jquery animate function does not working?

here is my code

                                        var inner_content_product = $("#inner_content_product").height();
                                        $("#products_main_contents").animate({ height: inner_content_product + "px" }, 1000);
0
Comment
Question by:njgroup
  • 2
4 Comments
 
LVL 6

Assisted Solution

by:Codebot
Codebot earned 150 total points
ID: 34179566
Try this one

 var inner_content_product = $("#inner_content_product").height() + "px";
 $("#products_main_contents").animate({"height": inner_content_product }, {duration: 1000});

or try to set the misbehaving div to overflow:hidden;
0
 
LVL 18

Accepted Solution

by:
Sudaraka Wijesinghe earned 350 total points
ID: 34179573
you jQuery code seem to be working fine. See http://jsfiddle.net/sudaraka/mR8YJ/
If it doesn't work in you script, the problem must be with HTML or CSS
0
 

Author Closing Comment

by:njgroup
ID: 34180137
sudaraka, you are correct, there was a problem in css

Codebot, thanks for response and support
0
 
LVL 18

Expert Comment

by:Sudaraka Wijesinghe
ID: 34180190
Glad to help. Thanks for the points.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question