zoukankan      html  css  js  c++  java
  • 使用SVG图像作为loading加载 以保证图像高清不模糊

    使用教程

    接下来设计达人网小编为大家讲解这个使用方法,其实是相当简单的。

    STEP 1: 复制你想要的SVG加载动画代码到<body>里面,小编随意复制一个代码如下:
    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="30px" viewBox="0 0 24 30" style="enable-background:new 0 0 50 50;" xml:space="preserve">
    <rect x="0" y="0" width="4" height="10" fill="#333" transform="translate(0 15.1665)">
    <animateTransform attributeType="xml" attributeName="transform" type="translate" values="0 0; 0 20; 0 0" begin="0" dur="0.6s" repeatCount="indefinite"></animateTransform>
    </rect>
    <rect x="10" y="0" width="4" height="10" fill="#333" transform="translate(0 11.5002)">
    <animateTransform attributeType="xml" attributeName="transform" type="translate" values="0 0; 0 20; 0 0" begin="0.2s" dur="0.6s" repeatCount="indefinite"></animateTransform>
    </rect>
    <rect x="20" y="0" width="4" height="10" fill="#333" transform="translate(0 1.83315)">
    <animateTransform attributeType="xml" attributeName="transform" type="translate" values="0 0; 0 20; 0 0" begin="0.4s" dur="0.6s" repeatCount="indefinite"></animateTransform>
    </rect>
    </svg>

    此时代码已经可以带动画了,但没颜色,请继续看STEP2添加颜色。

    STEP 2 : 为SVG图像添加颜色

    给你的样式表添加如下样式,里面的颜色代码换上你喜欢的即!
    <style>
    svg path,svg rect{fill: #FF6700;}
    </style>

    实例地址:http://codepen.io/aurer/pen/jEGbA

  • 相关阅读:
    字符串的排列
    二叉搜索树与双向链表
    复杂链表的复制
    二叉树中和为某一值的路径
    二叉搜索树的后序遍历序列
    从上往下打印二叉树
    python系统编程(一)
    python网络编程(十三)
    python网络编程(十二)
    python网络编程(十一)
  • 原文地址:https://www.cnblogs.com/luckyuns/p/6252459.html
Copyright © 2011-2022 走看看