Solved

so why jquery animate function does not working?

Posted on 2010-11-20
4
867 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

This article discusses four methods for overlaying images in a container on a web page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

759 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