Skip to content

Possible typo on animate API documentation #1157

Closed
@jordanmoore753

Description

@jordanmoore753

Hello! There may be a possible typo on the animate API documentation.

In the example shown, the code is:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>animate demo</title>
  <style>
  div {
    background-color: #bca;
    width: 100px;
    border: 1px solid green;
  }
  </style>
  <script src="https://code.jquery.com/jquery-3.4.1.js"></script>
</head>
<body>
 
<button id="go">&raquo; Run</button>
<div id="block">Hello!</div>
 
<script>
// Using multiple unit types within one animation.
 
$( "#go" ).click(function() {
  $( "#block" ).animate({
    width: "70%",
    opacity: 0.4,
    marginLeft: "0.6in",
    fontSize: "3em",
    borderWidth: "10px"
  }, 1500 );
});
</script>
 
</body>
</html>

However, the next paragraph explaining it says that:

The first button shows how an unqueued animation works. It expands the div out to 90% width while the font-size is increasing.

It is my understanding that the animate method expands the div out to 70% width, since the value for the width property in the properties object is 70%.

Thank you for reading this and have a great day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions