html5 svg世界地图热点动画特效

 时间:2026-04-22 11:27:29

1、新建html文档。

html5 svg世界地图热点动画特效

2、书写hmtl代码。

<div id="animationWindow"></div>

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">

html5 svg世界地图热点动画特效

</div>

html5 svg世界地图热点动画特效

3、书写css代码。

<style>

body {

 background-color: #153285;

 overflow: hidden;

 text-align: center;

}

body,

html {

 height: 100%;

 width: 100%;

 margin: 0;

 padding: 0;

}

#ani mationWindow {

 width: 100%;

 height: 100%;

}

</style>

html5 svg世界地图热点动画特效

4、书写并添加js代码。

<script src="js/bodymovin.min.js"></script>

<script>

var select = function(s) {

    return document.querySelector(s);

  },

  selectAll = function(s) {

    return document.querySelectorAll(s);

  }, 

  animationWindow = select('#animationWindow'),    

    animData = {

wrapper: animationWindow,

animType: 'svg',

loop: true,

prerender: true,

autoplay: true,

path: 'world.json' 

}, anim;

anim = bodymovin.loadAnimation(animData);

 anim.setSpeed(1.4);

</script>

html5 svg世界地图热点动画特效

5、代码整体结构。

html5 svg世界地图热点动画特效

6、查看效果。

html5 svg世界地图热点动画特效

  • win7打印机共享怎么设置
  • Windows server 2008 R2如何删除Windows凭据
  • FTP服务器搭建与管理
  • C#的SQL数据库如何连接服务器
  • filezilla应用如何修改更新状态
  • 热门搜索
    愈怎么读 金毛怎么训练才听话的 鬼压床是怎么回事 电脑cpu温度过高怎么办 羁怎么读 手肿胀是怎么回事 魔方怎么还原 头痛怎么办快速缓解小方法 怎么赚钱快现实点的 工作业绩怎么写