制作svg动画

本文介绍了一种使用SVG动画插件Lazy Line Painter的方法,通过该插件可以实现逐步绘制图像的效果。首先在Adobe Illustrator (AI) 中创建路径,然后保存为SVG格式。接着在HTML中引入jQuery和插件文件,并设置相应的SVG数据。通过插件将SVG路径进行动画绘制,实现了动态画图的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

要实现一步一步画出来一个图片,css3做不到吧,除非一张张的图片定时显示。想不到别的招了。现在用的是一个插件,做了一个svg动画。

插件地址:http://lazylinepainter.info/

先用AI做好路径,保存为svg格式的文件。

使用插件,先引入需要的文件:

 <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
 <script>window.jQuery || document.write('<script src="jquery-1.9.1.min.js"><\/script>')</script>
<script src="jquery.lazylinepainter-1.5.1.js"></script>

demo如下:

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title>Lazy Line Painter</title>
        <meta name="description" content="A Jquery plugin for SVG path animation">


        <link rel="icon" type="image/x-icon" href="/favicon.ico" />


        <style>
body {
background:#fffafa;
cursor: pointer;
}


#demo {
width:400px;
height:400px;
position:absolute;
left:50%;
margin:80px 0 0 -175px;
}


</style>


        <sc

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值