Web

如何在你的博客养一只猫

Lan
Lan
2020-05-12 / 2 评论 / 4,818 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2020年05月12日,已超过1406天没有更新,若内容或图片失效,请留言反馈。

效果在图的左下角

image.png

将下列代码插入到你的网页之中就可以啦。

<script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script>
  <script>
      L2Dwidget.init({
          "model": {
              jsonPath: "https://unpkg.com/live2d-widget-model-hijiki/assets/hijiki.model.json",<!--这里改模型,前面后面都要改-->
              "scale": 1
          },
          "display": {
              "position": "left",<!--设置看板娘的上下左右位置-->
              "width": 100, 
              "height": 200,
              "hOffset": 0,
              "vOffset": 0
          },
          "mobile": {
              "show": true,
              "scale": 0.5
          },
          "react": {
              "opacityDefault": 0.7,<!--设置透明度-->
              "opacityOnHover": 0.2
          }
      });
  window.onload = function(){
       $("#live2dcanvas").attr("style","position: fixed; opacity: 0.7; left: 70px; bottom: 0px; z-index: 1; pointer-events: none;")
  }
  </script>

left是调整距离左边多远

bottom调整距离底部多远

源码转载于网络,如有问题请联系:Vast@tom.com

1

评论 (2)

取消
  1. 头像
    Inkedus 作者
    Windows 10 · Google Chrome

    学会了,但是我不喜欢猫怎么办

    回复
  2. 头像
    Lan 作者
    Windows 10 · Google Chrome
    @ 访客

    哈哈,刚刚整理了一些其他模型{#ZC_BLOG_HOST#}post/305.html

    回复