EXAMPLE: http://jsbin.com/ewiko4/5/
So, I have some dynamic divs that I need to figure out when they change. I can get the height when the document is loading, but it will not be updated.
In the example, I added a larger button, but irl will be changed via jq and ajax
Yup, I cannot add a callback to the animation button because it will not be there.
Check out this edit of your jsbin.
A couple of changes:
Your window events can be tied at the same time $(window).bind('load resize', resizeFrame)
$(window).bind('load resize', resizeFrame)
resizeFrame , , ...
resizeFrame
, ( ), setInterval .
setInterval
setInterval(resizeFrame, 150);
resizeFrame 150 . , , , ...
, , externalHeight():
$('#makeBigger').click(function(){ $('#buyNow').animate({ height: '+=10px' }, function() { var newHeight = $('#buyNow').outerHeight(); // ... }) });
animate() , , , . , . <div> , , ajax.
animate()
<div>
var h = $('#content').height();
var h = 500; $('#content').height(h);
http://api.jquery.com/height/
, MultiView. , XXX.height(). ASP, .
Source: https://habr.com/ru/post/1763982/More articles:How can I let the user easily choose how much memory will be allocated in a Java Swing application? - javaObject Pascal: TClientDataset Removal - delphiHow to find a user on an LDAP server - c #Get expression parameter name - c #installing fonts in a client machine - javascriptTable of rights as keys for a dictionary - dictionaryThe procedure or function "" expects a parameter '' that has not been set - c #IList constructor parameter and AutoFixture - c #UITableView allows the Selection property for a specific section - objective-cVisual Studio crashes when I use a specific solution - visual-studio-2008All Articles