Content Editor Webpart (ii) Add jquery and HTML code

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.