How do I use jQuery's .animate method with min-height?
I am trying to use min-height
with jQuery.animate like this:
$insert.animate({ min-height : 52 }, 1000).animate({ opacity : 1 }, 1000);
but it breaks 开发者_开发知识库the script. If i use height : 52
it works. Any ideas?
edit: see demo
Try wrapping min-height
in quotes:
$insert.animate({ 'min-height' : 52 }, 1000).animate({ opacity : 1 }, 1000);
I should add: I'm assuming $insert
is a pointer to a block element, i.e. $insert = $('#insert')
, where #insert
is an HTML element with display: block
. I tried my solution in JSFiddle too.
$insert.animate({'min-height':'500px'}, 1000);
This is correct syntax using jQuery 1.7
精彩评论