Good day, the question is not crucial, just interested in:

for example, there is a div with id "t". Do diva registered style: padding: 100px;

I am writing jQuery code:

$(document).ready(function(){ $("#t").animate({ padding : 1000, }, 10000) }) 

Logically (in any case, I think so), the animation should start at 100 and pumped 1000, but the function resets the padding and the animation starts at 0. Is there any way in jquery to avoid this behavior?


So that, at least, the animation starts with the maximum or minimum values ​​of padding, margin (left, top, right, bottom) and not from zero.


Or at least something like

  $("#t").animate({ padding : 1000, from: 100 }, 

I do not understand what is the point (but in order to satisfy a person):

 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Animation</title> <style type="text/css">#t {padding:100px;}</style> <script type="text/javascript" src="/jquery.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function(){ $("#t").animate({ 'padding' : 1000, }, 10000) }) </script> <p id="t" style="padding:100px;">test</p> </body> </html> 

Sadly, the bug was discovered 14 months ago and nothing was done ...

Conclusion: so conceived xD

    1 answer 1

    Most likely jQury bug http://bugs.jquery.com/ticket/7399:
    Decision :

     'padding-top': '+=1000px', 'padding-left': '+=1000px', 'padding-right': '+=1000px', 'padding-bottom': '+=1000px' 
    • I tried, the result is the same - Zowie
    • try registering the padding directly in the tag, maybe something changes it? - Maksym Prus 2:44 pm
    • I have nothing on this page except for this code, nothing changes it. Directly in the tag wrote - as expected the result it did not give - Zowie
    • show the full code - Maksym Prus
    • one
      Vu pravu. Eto bug na samom dele bugs.jquery.com/ticket/7399 Reshenie - zadavat 'padding-top': '+ = 1000px', 'padding-left': '+ = 1000px', 'padding-right': '+ = 1000px ',' padding-bottom ':' + = 1000px ', - Maksym Prus