国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jQuery插件ImageDrawer.js實現(xiàn)動態(tài)繪制圖片動畫(附源碼下載)

2019-11-20 10:30:39
字體:
供稿:網(wǎng)友

ImageDrawer.js是一款可以實現(xiàn)動態(tài)繪制圖片動畫的jQuery插件。通過ImageDrawer.js插件,你可以制作在頁面中繪制圖片的動態(tài)過程,你可以控制繪制動畫的持續(xù)時間等參數(shù),非常有趣。

效果展示       源碼下載

使用方法

使用該動態(tài)繪制圖片插件需要在頁面中引入imagedrawer.css,jquery和imagedrawer.js文件。

<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結(jié)構(gòu)

在頁面中插入你需要繪制的圖片。

<div id="container"><img id="example" src="img.jpg"></div>

初始化插件

在頁面DOM元素加載完畢之后,可以通過下面的方法來初始化該圖片繪制插件。

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

配置參數(shù)

ImageDrawer.js圖片繪制插件有以下一些可用的配置參數(shù)。

$(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:繪制動畫的持續(xù)時間。可以是一個整數(shù),或是一個對象:

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

borderPencil:繪制邊框需要的時間。
pencilShades:繪制黑白陰影部分需要的時間。
colorShades:繪制彩色陰影需要的時間。
fullColors;填充顏色需要的時間。
background:畫布的背景顏色。

callback:回調(diào)函數(shù)。

pencil:在畫布上方顯示的鉛筆小圖標(biāo)。

以上所述是小編給大家介紹的jQuery插件ImageDrawer.js實現(xiàn)動態(tài)繪制圖片動畫(附源碼下載)的相關(guān)知識,希望對大家有所幫助!

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 太保市| 美姑县| 罗平县| 张掖市| 长顺县| 阳泉市| 剑阁县| 阳山县| 锦州市| 托里县| 乌拉特后旗| 松江区| 镇宁| 乌兰浩特市| 柳州市| 铜川市| 永清县| 正定县| 读书| 吴川市| 大安市| 澄城县| 庐江县| 甘洛县| 安塞县| 疏勒县| 离岛区| 梨树县| 广饶县| 仁化县| 汶川县| 开阳县| 全椒县| 嵊泗县| 铜山县| 都兰县| 漳浦县| 丽江市| 英吉沙县| 民和| 禄丰县|