码迷,mamicode.com
首页 > Web开发 > 详细

css3 svg路径蒙版动画

时间:2019-11-13 20:39:50      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:defs   https   width   footer   body   char   java   form   none   

css3 svg路径蒙版动画

具体看https://www.cnblogs.com/oubenruing/p/9568954.html

还有个更好控制的写法
<pre>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<title>{$title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<!-- Link Swiper‘s CSS -->
<include file="commonheader" />
</head>

<body>
<include file="jiazai" />
<include file="commonmokuai" />
<div class="showcontainer" style="display: block;">
<div style="width:60%; height: 7.5rem; position: absolute;left:0px;top:0px;">
<svg width="100%" height="100%" viewBox="0,0,246,120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
<defs>
<mask id ="path1">
<path id="path" stroke="white" fill="none" stroke-width="20" d="M238,8L75.3,103.7c0,0-5.3,7.7-18,0S10.3,73,10.3,73" class="Path1"></path>
</mask>
</defs>
<image mask="url(#path1)" style="overflow:visible;" width="246" height="120" id="左下发光条" xlink:href="/moban/123.png">
</image>
</svg>

</div>
</div>
<script src="{$yuming}/js/TweenMax.js"></script>
<script src="{$yuming}/js/DrawSVGPlugin.min.js"></script>
<include file="commonfooter" />
<script type="text/javascript">
$(function() {
myTween = TweenMax.fromTo("#path", 1, { drawSVG: "0%" }, { drawSVG: "100%" });
// myTween.yoyo(true).repeat(-1);
})
</script>
</body>

</html>
</pre>

css3 svg路径蒙版动画

标签:defs   https   width   footer   body   char   java   form   none   

原文地址:https://www.cnblogs.com/newmiracle/p/11852953.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!