Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

so why jquery animate function does not working?

Posted on 2010-11-20
4
Medium Priority
?
872 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 600 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 1400 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

722 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