In the previous article (Content Editor WebPart (i) refers to jquery), how to refer to jquery in the Content Editor WebPart is described in this article if the Content editor Add HTML and jquery code to the WebPart.
Follow the previous steps to edit the Content Editor's source code for WebPart, and enter the following code:
<div style= "height:200px;" ><script type= "Text/javascript" src= "/sites/apps/style%20library/jquery-1.10.2.min.js" ></script> <script> $ (document). Ready (function () { $ ("#btnStr"). Click (function () { $ ("#move"). Animate ({left: ' 250px '});}) ; </script><button id= "Btnstr" onclick= "Movediv ()" >start animation</button><p>by default, all The HTML elements has a static position, and cannot be moved. <br/>to manipulate the position, remember to first set the CSS position property of the element to relative, fixed, or Absolute!</p><div id= "move" style= "height:100px; width:100px; Position:absolute; Background: #98bf21; " ></div> </div>
When you're done saving it, it shows up like this:
When you click Start Animation, the green div block will move:
Click
Content Editor Webpart (ii) Add jquery and HTML code