The jQuery extension ImageDrawer. js allows you to dynamically draw image animations (with source code download ),

Source: Internet
Author: User

The jQuery extension ImageDrawer. js allows you to dynamically draw image animations (with source code download ),

ImageDrawer. js is a jQuery plug-in that allows you to dynamically draw image animations. By using the ImageDrawer. js plug-in, you can create a dynamic process for drawing images on the page. You can control the animation duration and other parameters, which is very interesting.

Effect displaySource code download

Usage

Use this animated image plug-in to import imagedrawer.css, jquery, and imagedrawer. js files to the page.

<link rel="stylesheet" href="css/imagedrawer.css" type="text/css"/><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/imagedrawer.js"></script>

HTML Structure

Insert the image you want to draw into the page.

<div id="container"></div>

Initialize the plug-in

After the page DOM element is loaded, you can initialize the image rendering plug-in using the following method.

$('div#container').drawImage();

Configuration parameters

The ImageDrawer. js Image Rendering plug-in provides the following configuration parameters.

$(div#container).drawImge({duration: 20, @number - seconds it's take to draw the entire pictureInstead of specifying the duration on the whole animation,|| { it's also possible to set the duration of single drawing phases:borderPencil : 9, @number - seconds it's take to draw the picture by using only the pencil for borderspencilShades : 6, @number - seconds it's take to draw sharpest shades with black pencilcolorShades : 7.5, @number - seconds it's take to draw first, basic, vanish colorsfullColors : 7.5 @number - seconds it's take to define better all colors on the picture},background: '#949494', @string - background color for image while it's been drawingcallback: fn(), @function - function to execute after the last phasepencil: {height: '50px',width : '50px',src : './img/pencil.png' @string - path to the pencil image}});

Duration: Specifies the animation duration. It can be an integer or an object:

{borderPencil : 9, pencilShades : 6, colorShades : 7.5, fullColors : 7.5 }

Borderpenpencil: the time required to draw a border.
PencilShades: the time required to draw the black and white shadows.
ColorShades: the time required to draw a color shadow.
FullColors; the time required to fill the color.
Background: the background color of the canvas.

Callback: callback function.

Pencil: pencil icon displayed above the canvas.

The above section describes how to use the jQuery plug-in ImageDrawer. js to dynamically draw image animations (with source code download). I hope it will help you!

Articles you may be interested in:
  • JqPlot jquery's page chart plotting tool
  • Use the jQuery jqPlot plug-in to draw a bar chart
  • JQuery. Highcharts. js

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.