Solved

so why jquery animate function does not working?

Posted on 2010-11-20
4
865 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

816 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now