整合營(yíng)銷服務(wù)商

          電腦端+手機(jī)端+微信端=數(shù)據(jù)同步管理

          免費(fèi)咨詢熱線:

          前端基礎(chǔ):必須要知道的移動(dòng)端適配(9)-圖片模糊問題

          前端基礎(chǔ):必須要知道的移動(dòng)端適配(9)-圖片模糊問題

          產(chǎn)生原因

          平時(shí)使用的圖片大多數(shù)都屬于位圖(png、jpg...),位圖由一個(gè)個(gè)像素點(diǎn)構(gòu)成的,每個(gè)像素都具有特定的位置和顏色值:

          理論上,位圖的每個(gè)像素對(duì)應(yīng)在屏幕上使用一個(gè)物理像素來渲染,才能達(dá)到最佳的顯示效果。

          而在dpr > 1的屏幕上,位圖的一個(gè)像素可能由多個(gè)物理像素來渲染,然而這些物理像素點(diǎn)并不能被準(zhǔn)確的分配上對(duì)應(yīng)位圖像素的顏色,只能取近似值,所以相同的圖片在dpr > 1的屏幕上就會(huì)模糊:

          解決方案

          為了保證圖片質(zhì)量,我們應(yīng)該盡可能讓一個(gè)屏幕像素來渲染一個(gè)圖片像素,所以,針對(duì)不同DPR的屏幕,我們需要展示不同分辨率的圖片。

          如:在dpr=2的屏幕上展示兩倍圖(@2x),在dpr=3的屏幕上展示三倍圖(@3x)。

          media查詢

          使用media查詢判斷不同的設(shè)備像素比來顯示不同精度的圖片:

           .avatar{
           background-image: url(conardLi_1x.png);
           }
           @media only screen and (-webkit-min-device-pixel-ratio:2){
           .avatar{
           background-image: url(conardLi_2x.png);
           }
           }
           @media only screen and (-webkit-min-device-pixel-ratio:3){
           .avatar{
           background-image: url(conardLi_3x.png);
           }
           }
          

          只適用于背景圖

          image-set

          使用image-set:

          .avatar {
           background-image: -webkit-image-set( "conardLi_1x.png" 1x, "conardLi_2x.png" 2x );
          }
          

          只適用于背景圖

          srcset

          使用img標(biāo)簽的srcset屬性,瀏覽器會(huì)自動(dòng)根據(jù)像素密度匹配最佳顯示圖片:

          <img src="conardLi_1x.png" srcset=" conardLi_2x.png 2x, conardLi_3x.png 3x">
          

          JavaScript拼接圖片url

          使用window.devicePixelRatio獲取設(shè)備像素比,遍歷所有圖片,替換圖片地址:

          const dpr=window.devicePixelRatio;
          const images=document.querySelectorAll('img');
          images.forEach((img)=>{
           img.src.replace(".", `@${dpr}x.`);
          })
          

          使用svg

          SVG的全稱是可縮放矢量圖(Scalable Vector Graphics)。不同于位圖的基于像素,SVG 則是屬于對(duì)圖像的形狀描述,所以它本質(zhì)上是文本文件,體積較小,且不管放大多少倍都不會(huì)失真。

          除了我們手動(dòng)在代碼中繪制svg,我們還可以像使用位圖一樣使用svg圖片:

          CSS 是什么?

          CSS是Cascading Style Sheets的簡(jiǎn)稱,中文稱為層疊樣式表。

          屬性和屬性值用冒號(hào)隔開,以分號(hào)結(jié)尾。

          CSS 四種引入方式:

          1.行內(nèi)式

          行內(nèi)式是在標(biāo)簽的style屬性中設(shè)定CSS樣式。

          <div style="..."></div>

          2.嵌入式

          嵌入式是將CSS樣式集中寫在網(wǎng)頁的<head>標(biāo)簽的<style></style>標(biāo)簽對(duì)中。

          <head>
          
              ...
          
              <style type="text/css">
          
                  ...此處寫CSS樣式
          
              </style>
          
          </head>

          3.導(dǎo)入式
          將一個(gè)獨(dú)立的.css文件引入HTML文件中,導(dǎo)入式使用@import 引入外部CSS文件,<style>標(biāo)記也是寫在<head>標(biāo)記中。

          導(dǎo)入式會(huì)在整個(gè)網(wǎng)頁裝載完后再裝載CSS文件。

          <head>
          
              ...
          
              <style type="text/css">
          
                  @import "My.css"; 此處注意.css文件的路徑
          
              </style>
          
          </head>

          4.鏈接式
          將一個(gè)獨(dú)立的.css文件引入到HTML文件中,使用<link>標(biāo)記寫在<head>標(biāo)記中。

          鏈接式會(huì)以網(wǎng)頁文件主體裝載前裝載CSS文件。

          <head>
          
              ...
          
              <link href="My.css" rel="stylesheet" type="text/css">
          
          </head>
          
          

          樣式應(yīng)用順序:

          • 行內(nèi)樣式優(yōu)先級(jí)最高
          • 針對(duì)相同的樣式屬性,不同的樣式屬性將以合并的方式呈現(xiàn)
          • 相同樣式并且相同屬性,呈現(xiàn)方式在<head>中的順序決定,后面會(huì)覆蓋前面屬性
          • !important 指定樣式規(guī)則應(yīng)用最優(yōu)先
          .nick {
              color: yellow !important;
          }

          選擇器(Selector)

          基本選擇器:

          1.通用元素選擇器

          * 表示應(yīng)用到所有的標(biāo)簽。

          * {color: yellow}

          2.標(biāo)簽選擇器

          匹配所有使用 div 標(biāo)簽的元素(可以匹配所有標(biāo)簽)

          div {color: yellow}

          3.類選擇器

          匹配所有class屬性中包含info的元素。

          語法:.類名{樣式}(類名不能以數(shù)字開頭,類名要區(qū)分大小寫。)

          .Mycolor {color: yellow}
          <h3 class="Mycolor">nick</h3>

          4.ID選擇器

          使用id屬性來調(diào)用樣式,在一個(gè)網(wǎng)頁中id的值都是唯一的(是W3C規(guī)范而不是規(guī)則,所以不會(huì)報(bào)錯(cuò))。

          語法:#ID名{樣式}(ID名不能以數(shù)字開頭)

          #Mycolor {color: yellow}
          <h3 id="Mycolor">Nick.</h3>

          組合選擇器:

          1.多元素選擇器

          同時(shí)匹配h3,h4標(biāo)簽,之間用逗號(hào)分隔。

          h3,h4 {color: yellow;}
          <h3>Nick</h3>
          <h4>Jenny</h4>
          

          2.后代元素選擇器

          匹配所有div標(biāo)簽里嵌套的P標(biāo)簽,之間用空格分隔。

              div p {color: yellow;}
          <div>
              <p>Nick</p>
              <div>
                  <p>Nick</p>
              </div>
          </div>

          3.子元素選擇器

          匹配所有div標(biāo)簽里嵌套的子P標(biāo)簽,之間用>分隔。

              div > p {color: yellow;}
          <div>
              <p>Nick</p>
              <p>Nick</p>
          </div>

          4.毗鄰元素選擇器

          匹配所有緊隨div標(biāo)簽之后的同級(jí)標(biāo)簽P,之間用+分隔(只能匹配一個(gè))。

              div + p {color: yellow;}
          <div>Nick</div>
          <p>Nick</p>

          屬性選擇器:

          1.[title] & P[title]

          設(shè)置所有具有title屬性的標(biāo)簽元素;

          設(shè)置所有具有title屬性的P標(biāo)簽元素。

              [title]
              {
                  color: yellow;
              }
              p[title]
              {
                  color: yellow;
              }
           
          <div title>Nick</div>
          <p title>Nick</p>

          2.[title=Nick]

          設(shè)置所有title屬性等于“Nick”的標(biāo)簽元素。

              [title="Nick"]
              {
                  color: yellow;
              }
          <p title="Nick">Nick</p>

          3.[title~=Nick]

          設(shè)置所有title屬性具有多個(gè)空格分隔的值、其中一個(gè)值等于“Nick”的標(biāo)簽元素。

              [title~="Nick"]
              {
                  color: yellow;
              }
          <p title="Nick Jenny">Nick</p>
          <p title="Jenny Nick">Nick</p>

          4.[title|=Nick]

          設(shè)置所有title屬性具有多個(gè)連字號(hào)分隔(hyphen-separated)的值、其中一個(gè)值以"Nick"開頭的標(biāo)簽元素。

          例:lang屬性:"en"、"en-us"、"en-gb"等等

              [title|="Nick"]
              {
                  color: yellow;
              }
           <p title="Nick-Jenny">Nick</p>
          

          5.[title^=Nick]

          設(shè)置屬性值以指定值開頭的每個(gè)標(biāo)簽元素。

              [title^="Nick"]
              {
                  color: yellow;
              }
          <p title="NickJenny">Nick</p>

          6.[title$=Nick]

          設(shè)置屬性值以指定值結(jié)尾的每個(gè)標(biāo)簽元素。

              [title$="Nick"]
              {
                  color: yellow;
              }
          <p title="JennyNick">Nick</p>

          7.[title*=Nick]

          設(shè)置屬性值中包含指定值的每個(gè)元素

          [title*="Nick"]
              {
                  color: yellow;
              }
           
          <p title="SNickJenny">Nick</p>

          偽類選擇器:

          1. link、hover、active、visited

          • a:link(未訪問的鏈接狀態(tài)),用于定義了常規(guī)的鏈接狀態(tài)。
          • a:hover(鼠標(biāo)放在鏈接上的狀態(tài)),用于產(chǎn)生視覺效果。
          • a:active(在鏈接上按下鼠標(biāo)時(shí)的狀態(tài))。
          • a:visited(已訪問過的鏈接狀態(tài)),可以看出已經(jīng)訪問過的鏈接。
              a:link{color: black}
              a:hover{color: yellow}
              a:active{color: blue}
              a:visited{color: red} 
          <a href="#">Nick</a>

          2. before、after

          • P:before 在每個(gè)<p>元素的內(nèi)容之前插入內(nèi)容;
          • P:after 在每個(gè)<p>元素的內(nèi)容之后插入內(nèi)容。
              p {
                  color: yellow;
              }
              p:before{
                  content: "before...";
              }
              p:after{
                  content: "after...";
              }
           <p> Nick </p>  

          常用屬性

          1. 顏色屬性:

          color

          • HEX(十六進(jìn)制色:color: #FFFF00 --> 縮寫:#FF0)
          • RGB(紅綠藍(lán),使用方式:color:rgb(255,255,0)或者color:rgb(100%,100%,0%))
          • RGBA(紅綠藍(lán)透明度,A是透明度在0~1之間取值。使用方式:color:rgba(255,255,0,0.5))
          • HSL(CSS3有效,H表示色調(diào),S表示飽和度,L表示亮度,使用方式:color:hsl(360,100%,50%))
          • HSLA(和HSL相似,A表示Alpha透明度,取值0~1之間。)

          transparent

          • 全透明,使用方式:color: transparent;

          opacity

          • 元素的透明度,語法:opacity: 0.5;
          • 屬性值在0.0到1.0范圍內(nèi),0表示透明,1表示不透明。
          • filter濾鏡屬性(只適用于早期的IE瀏覽器,語法:filter:alpha(opacity:20);)。

          2. 字體屬性:

          font-style: 用于規(guī)定斜體文本

          • normal 文本正常顯示
          • italic 文本斜體顯示
          • oblique 文本傾斜顯示

          font-weight: 設(shè)置文本的粗細(xì)

          • normal(默認(rèn))
          • bold(加粗)
          • bolder(相當(dāng)于<strong>和<b>標(biāo)簽)
          • lighter (常規(guī))
          • 100 ~ 900 整百(400=normal,700=bold)

          font-size: 設(shè)置字體的大小

          • 默認(rèn)值:medium
          • <absolute-size>可選參數(shù)值:xx-small、 x-small、 small、 medium、 large、 x-large、 xx-large
          • <relative-size>相對(duì)于父標(biāo)簽中字體的尺寸進(jìn)行調(diào)節(jié)。可選參數(shù)值:smaller、 larger
          • <percentage>百分比指定文字大小。
          • <length>用長(zhǎng)度值指定文字大小,不允許負(fù)值。

          font-family:字體名稱

          • 使用逗號(hào)隔開多種字體(優(yōu)先級(jí)從前向后,如果系統(tǒng)中沒有找到當(dāng)前字體,則往后面尋找)

          font:簡(jiǎn)寫屬性

          • 語法:font:字體大小/行高 字體;(字體要在最后)

          3. 文本屬性:

          white-space: 設(shè)置元素中空白的處理方式

          • normal:默認(rèn)處理方式。
          • pre:保留空格,當(dāng)文字超出邊界時(shí)不換行
          • nowrap:不保留空格,強(qiáng)制在同一行內(nèi)顯示所有文本,直到文本結(jié)束或者碰到br標(biāo)簽
          • pre-wrap:保留空格,當(dāng)文字碰到邊界時(shí)換行
          • pre-line:不保留空格,保留文字的換行,當(dāng)文字碰到邊界時(shí)換行

          direction: 規(guī)定文本的方向

          • ltr 默認(rèn),文本方向從左到右。
          • rtl 文本方向從右到左。

          text-align: 文本的水平對(duì)齊方式

          • left
          • center
          • right

          line-height: 文本行高

          • normal 默認(rèn)

          vertical-align: 文本所在行高的垂直對(duì)齊方式

          • baseline 默認(rèn)
          • sub 垂直對(duì)齊文本的下標(biāo),和<sub>標(biāo)簽一樣的效果
          • super 垂直對(duì)齊文本的上標(biāo),和<sup>標(biāo)簽一樣的效果
          • top 對(duì)象的頂端與所在容器的頂端對(duì)齊
          • text-top 對(duì)象的頂端與所在行文字頂端對(duì)齊
          • middle 元素對(duì)象基于基線垂直對(duì)齊
          • bottom 對(duì)象的底端與所在行的文字底部對(duì)齊
          • text-bottom 對(duì)象的底端與所在行文字的底端對(duì)齊

          text-indent: 文本縮進(jìn)

          letter-spacing: 添加字母之間的空白

          word-spacing: 添加每個(gè)單詞之間的空白

          text-transform: 屬性控制文本的大小寫

          • capitalize 文本中的每個(gè)單詞以大寫字母開頭。
          • uppercase 定義僅有大寫字母。
          • lowercase 定義僅有小寫字母。

          text-overflow: 文本溢出樣式

          • clip 修剪文本。
          • ellipsis 顯示省略符號(hào)...來代表被修剪的文本。
          • string 使用給定的字符串來代表被修剪的文本。
          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <!--<link href="cc2.css" rel="stylesheet" type="text/css">-->
              <style>
                  div {
                      width: 100px;
                      height: 100px;
                      white-space: nowrap;
                      overflow: hidden;
                      text-overflow: ellipsis;
                  }
              </style>
          </head>
          <body>
              <div>索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧 索寧</div>
          </body>
          </html>

          text-decoration: 文本的裝飾

          • none 默認(rèn)。
          • underline 下劃線。
          • overline 上劃線。
          • line-through 中線。

          text-shadow:文本陰影

          • 第一個(gè)參數(shù)是左右位置
          • 第二個(gè)參數(shù)是上下位置
          • 第三個(gè)參數(shù)是虛化效果
          • 第四個(gè)參數(shù)是顏色
          • text-shadow: 5px 5px 5px #888;

          word-wrap:自動(dòng)換行

          • word-wrap: break-word;
          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <style>
                  p {
                      width: 150px;
                      height: 160px;
                      background-color: #FFA500;
                      /*邊框陰影*/
                      box-shadow: 10px 10px 5px #888;
                      /*自動(dòng)換行*/
                      word-wrap: break-word;
                  }
                  h1 {
                      text-shadow: 5px 5px 5px #888;
                  }
              </style>
          </head>
          <body>
              <p>
                  When you are old and grey and full of sleep,And nodding by the fire, take down this book,And slowly read, and dream of the soft look
              </p>
              <h1>索寧</h1>
          </body>
          </html>    

          a {
              text-decoration: none;
              /*去除a標(biāo)簽下劃線*/
          }

          4. 背景屬性

          background-color: 背景顏色

          background-image 設(shè)置圖像為背景

          • url("http://images.cnblogs.com/cnblogs_com/suoning/845162/o_ns.png"); 圖片地址
          • background-image:linear-gradient(green,blue,yellow,red,black); 顏色漸變效果

          background-position 設(shè)置背景圖像的位置坐標(biāo)

          • background-position: center center; 圖片置中,x軸center,y軸center
          • 1px -195px 截取圖片某部分,分別代表坐標(biāo)x,y軸

          background-repeat 設(shè)置背景圖像不重復(fù)平鋪

          • no-repeat 設(shè)置圖像不重復(fù),常用
          • round 自動(dòng)縮放直到適應(yīng)并填充滿整個(gè)容器
          • space 以相同的間距平鋪且填充滿整個(gè)容器

          background-attachment 背景圖像是否固定或者隨著頁面的其余部分滾動(dòng)

          background 簡(jiǎn)寫

          • background: url("o_ns.png") no-repeat 0 -196px;
          • background: url("o_ns.png") no-repeat center bottom 15px;
          • background: url("o_ns.png") no-repeat left 30px bottom 15px;

          5. 列表屬性

          list-style-type: 列表項(xiàng)標(biāo)志的類型

          • none 去除標(biāo)志
          • decimal-leading-zero; 02.
          • square; 方框
          • circle; 空心圓
          • upper-alph; & disc; 實(shí)心圓

          list-style-image:將圖象設(shè)置為列表項(xiàng)標(biāo)志

          list-style-position:列表項(xiàng)標(biāo)志的位置

          • inside
          • outside

          list-style:縮寫

          頁面布局

          1. 邊框

          border-style:邊框樣式

          • solid 默認(rèn),實(shí)線
          • double 雙線
          • dotted 點(diǎn)狀線條
          • dashed 虛線

          border-color:邊框顏色

          border-width:邊框?qū)挾?/strong>

          border-radius:圓角

          • 1個(gè)參數(shù):四個(gè)角度應(yīng)用
          • 2個(gè)參數(shù):第一個(gè)參數(shù)應(yīng)用于 左上、右下;第二個(gè)參數(shù)應(yīng)用于 左下、右上
          • 3個(gè)參數(shù):第一個(gè)參數(shù)應(yīng)用于 左上;第二個(gè)參數(shù)應(yīng)用于 左下、右上;第三個(gè)參數(shù)應(yīng)用于右下
          • 4個(gè)參數(shù):左上、右上、右下、左下(順時(shí)針)

          border: 簡(jiǎn)寫

          • border: 2px yellow solid;

          box-shadow:邊框陰影

          • 第一個(gè)參數(shù)是左右位置
          • 第二個(gè)參數(shù)是上下位置
          • 第三個(gè)參數(shù)是虛化效果
          • 第四個(gè)參數(shù)是顏色
          • box-shadow: 10px 10px 5px #888;
          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <style>
                  div {
                      border:2px solid;
                      border-radius:25px;
                      width: 140px;
                  }
              </style>
          </head>
          <body>
              <div>
                   點(diǎn)贊哦!dear. 
              </div>
          </body>
          </html>

          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <style>
                  .radius1 {
                      display: inline-block;
                      width: 100px;
                      height: 100px;
                      background-color: yellow;
                      border-radius: 20px;
                  }
                  .radius2 {
                      display: inline-block;
                      width: 100px;
                      height: 100px;
                      background-color: red;
                      border-radius: 20px 35px;
                  }
                  .radius3 {
                      display: inline-block;
                      width: 100px;
                      height: 100px;
                      background-color: blue;
                      border-radius: 20px 35px 50px;
                  }
                  .radius4 {
                      display: inline-block;
                      width: 100px;
                      height: 100px;
                      background-color: green;
                      border-radius: 20px 35px 50px 60px;
                  }
              </style>
          </head>
          <body>
              <div>
                  <span class="radius1"></span>
                  <span class="radius2"></span>
                  <span class="radius3"></span>
                  <span class="radius4"></span>
              </div>
          </body>
          </html>

          邊框?qū)崿F(xiàn)各種三角符號(hào):

          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <style>
                  .triangle-one {
                      display: inline-block;
                      border-top: 50px red solid;
                      border-right: 50px green solid;
                      border-bottom: 50px yellow solid;
                      border-left: 50px blue solid;
                  }
                  .triangle-two {
                      display: inline-block;
                      border-top: 0 red solid;
                      border-right: 50px green solid;
                      border-bottom: 50px yellow solid;
                      border-left: 50px blue solid;
                  }
                  .triangle-stree {
                      display: inline-block;
                      border-top: 50px red solid;
                      border-right: 0 green solid;
                      border-bottom: 50px yellow solid;
                      border-left: 50px blue solid;
                  }
                  .triangle-four {
                      display: inline-block;
                      border-top: 50px red solid;
                      border-right: 0 green solid;
                      border-bottom: 0 yellow solid;
                      border-left: 50px blue solid;
                  }
           
                  .triangle-five {
                      display: inline-block;
                      border: 50px transparent solid;
                      border-top: 50px red solid;
                  }
                  .triangle-six {
                      display: inline-block;
                      border: 50px transparent solid;
                      border-bottom: 50px yellow solid;
                  }
                  .triangle-seven {
                      display: inline-block;
                      border: 50px transparent solid;
                      border-top: 60px red solid;
                      border-right: 0;
                  }
                  .triangle-eight {
                      display: inline-block;
                      border: 50px transparent solid;
                      border-left: 30px yellow solid;
                      border-bottom: 0;
                  }
              </style>
          </head>
          <body>
              <div class="triangle-one"></div>
              <div class="triangle-two"></div>
              <div class="triangle-stree"></div>
              <div class="triangle-four"></div>
              <div class="triangle-five"></div>
              <div class="triangle-six"></div>
              <div class="triangle-seven"></div>
              <div class="triangle-eight"></div>
          </body>
          </html>

          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <style>
                  .back {
                      width: 1000px;
                      height: 1000px;
                      margin: 0 auto;
                      background-color: #ddd;
                      position: relative;
                  }
                  .back-in {
                      position: absolute;
                      width: 1020px;
                      height: 45px;
                      left: -20px;
                      top: 50px;
                      background-color: #2F4F4F;
                  }
                  .back-img {
                      border: 20px solid transparent;
                      border-top: 10px solid dimgrey;
                      border-right: 0;
                      display: inline-block;
                      position: absolute;
                      top: 95px;
                      left: -20px;
                  }
                  .back-font {
                      line-height: 9px;
                      margin-left: 30px;
                      color: white;
                  }
              </style>
          </head>
          <body>
              <div class="back">
                  <div class="back-in"><h3 class="back-font">妹子求關(guān)注 ^.^</h3></div>
                  <div class="back-img"></div>
              </div>
          </body>
          </html>

          2.★ 盒子模型

          一個(gè)標(biāo)準(zhǔn)的盒子模型:

          padding:用于控制內(nèi)容與邊框之間的距離;

          margin: 用于控制元素與元素之間的距離;

          一個(gè)參數(shù),應(yīng)用于四邊。

            兩個(gè)參數(shù),第一個(gè)用于上、下,第二個(gè)用于左、右。

            三個(gè)參數(shù),第一個(gè)用于上,第二個(gè)用于左、右,第三個(gè)用于下。

          邊框在默認(rèn)情況下會(huì)定位于瀏覽器窗口的左上角,但是并沒有緊貼著瀏覽器的窗口的邊框,這是因?yàn)閎ody本身也是一個(gè)盒子,外層還有html,
          在默認(rèn)情況下,body距離html會(huì)有若干像素的margin,所以body中的盒子不會(huì)緊貼瀏覽器窗口的邊框了。
          
          解決方法:
          body {
              margin: 0;
          }

          3.★ display

          • none 不顯示。
          • block 顯示為塊級(jí)元素。
          • inline 顯示為內(nèi)聯(lián)元素。
          • inline-block 行內(nèi)塊元素(會(huì)保持塊元素的高寬)。
          • list-item 顯示為列表元素。

          4. visibility

          • visible 元素可見
          • hidden 元素不可見
          • collapse 當(dāng)在表格元素中使用時(shí),此值可刪除一行或一列,不會(huì)影響表格的布局。

          5.★ float 浮動(dòng)

          讓一行顯示兩個(gè)塊級(jí)標(biāo)簽,會(huì)脫離文檔流

          • none
          • left 左浮動(dòng)
          • right 右浮動(dòng)

          clear 清除浮動(dòng):

          • none : 默認(rèn)值。允許兩邊都可以有浮動(dòng)對(duì)象
          • left : 不允許左邊有浮動(dòng)對(duì)象
          • right : 不允許右邊有浮動(dòng)對(duì)象
          • both : 不允許兩邊有浮動(dòng)對(duì)象

          6. clip 剪裁圖像

          rect 剪裁定位元素:

          • auto 默認(rèn)值,無剪切
          • 上-右-下-左(順時(shí)針)的順序提供四個(gè)偏移值
          • 區(qū)域外的部分是透明的
          • 必須指定 position:absolute;
          • 例:clip:rect(0px,60px,200px,0px);

          7. overflow 設(shè)置當(dāng)對(duì)象的內(nèi)容超過其指定高度及寬度時(shí)如何顯示內(nèi)容

          • visible 默認(rèn)值,內(nèi)容不會(huì)被修剪,會(huì)呈現(xiàn)在元素框之外。
          • hidden 內(nèi)容會(huì)被修剪,并且其余內(nèi)容是不可見的。
          • scroll 內(nèi)容會(huì)被修剪,但是瀏覽器會(huì)顯示滾動(dòng)條以便查看其余的內(nèi)容。
          • auto 如果內(nèi)容被修剪,則瀏覽器會(huì)顯示滾動(dòng)條以便查看其余的內(nèi)容。

          8.★ position 規(guī)定元素的定位類型

          • 通過以下四種屬性進(jìn)行定位:
          • left
          • top
          • right
          • bottom
          • z-index

          9. z-index 元素層疊順序

          • z-index 僅在定位元素上有效(例:position:absolute;)
          • 可以指定負(fù)數(shù)屬性值(例:-1;)
          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <style>
                  .z-index1 {
                      width: 100px;
                      height: 100px;
                      background-color: yellow;
                      position: absolute;
                      z-index: -1;
                  }
                  .z-index2 {
                      width: 100px;
                      height: 100px;
                      background-color: red;
                      position: absolute;
                      top: 20px;
                      left: 20px;
                      z-index: 5;
                  }
              </style>
          </head>
          <body>
              <div class="z-index1"></div>
              <div class="z-index2"></div>
          </body>
          </html>

          10. outline 邊框輪廓

          • outline-width 輪廓寬度
          • outline-color 輪廓顏色
          • outline-style 輪廓樣式

          11. zoom 縮放比例

          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <style>
                  .zoom1 {
                      zoom: 100%;
                  }
                  .zoom2 {
                      zoom: 150%;
                  }
                  .zoom3 {
                      zoom: 200%;
                  }
              </style>
          </head>
          <body>
              <div class="zoom1">Nick 100%</div>
              <div class="zoom2">Nick 200%</div>
              <div class="zoom3">Nick 300%</div>
          </body>
          </html>

          12. cursor 鼠標(biāo)的類型形狀

          鼠標(biāo)放在以下單詞上,There will be a miracle:

          url: 自定義光標(biāo)

          <!DOCTYPE html>
          <html lang="en">
          <head>
              <meta charset="UTF-8">
              <title>Title</title>
              <!--<link href="cc2.css" rel="stylesheet" type="text/css">-->
              <style>
                  body {
                      cursor: url("mouse.png"), auto;
                      /*圖片地址:http://images.cnblogs.com/cnblogs_com/suoning/845162/o_mouse.png*/
                  }
              </style>
          </head>
          <body>
              <div><img src="http://images.cnblogs.com/cnblogs_com/suoning/845162/o_ns.png" height="100%" width="100%"></div>
          </body>
          </html>

          Auto: 默認(rèn)
          Default: 默認(rèn)
          e-resize
          ne-resize
          nw-resize
          n-resize
          se-resize
          sw-resize
          s-resize
          w-resize
          Crosshair
          Pointer
          Move
          text
          wait
          help

          not-allowed

          13. transform、transition 動(dòng)畫效果

          transform 轉(zhuǎn)換,變形

          • origin 定義旋轉(zhuǎn)基點(diǎn)(left top center right bottom 坐標(biāo)值) transform-origin: 50px 50px; transform-origin: left;。
          • rotate 旋轉(zhuǎn) transform:rotate(50deg) 旋轉(zhuǎn)角度可以為負(fù)數(shù),需要先定義origin。
          • skew 扭曲 transform:skew(50deg,50deg) 分別為相對(duì)x軸傾斜,相對(duì)y軸傾斜。
          • scale 縮放 transform:scale(2,3) 橫向放大2倍,縱向放大3倍;transform:scale(2) 橫豎都放大2倍。
          • translate 移動(dòng) transform:translate(50px, 50px) 分別為相對(duì)x軸移動(dòng),相對(duì)y軸移動(dòng)。
          <!DOCTYPE html>
          <html>
          <head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
              <title>nick</title>
              <meta charset="utf-8" />
              <style type="text/css">
                  div {
                      border: 1px solid black;
                      height: 30px;
                      width: 30px;
                      background-color: yellow;
           
                      /*transform-origin: 50px 50px;*/
                      transform-origin: left;
                      transform: rotate(50deg);
                      /*transform: skew(50deg,50deg);*/
                      /*transform: translate(50px,50px);*/
                      /*transform: scale(2);*/
                  }
              </style>
          </head>
          <body>
              <div></div>
          </body>
          </html>


          Transition 平滑過渡

          • transition-property: 變換的屬性(none(沒有屬性改變)、all(所有屬性改變)、具體屬性)
          • transition-duration: 變換持續(xù)時(shí)間
          • transition-timing-function: 變換的速率(ease:(逐漸變慢)、linear:(勻速)、ease-in:(加速)、ease-out:(減速)、ease-in-out:(加速然后減速)、cubic-bezier:(自定義時(shí)間曲線))
          • transition-delay: 變換延遲時(shí)間
          • transition: 縮寫
          #property 指定屬性對(duì)應(yīng)類型
          
          1、color: 通過紅、綠、藍(lán)和透明度組件變換(每個(gè)數(shù)值單獨(dú)處理),如:background-color,border-color,color,outline-color等CSS屬性;
          
          2、length:真實(shí)的數(shù)字,如:word-spacing,width,vertical- align,top,right,bottom,left,padding,outline-width,margin,min-width,min- height,max-width,max-height,line-height,height,border-width,border- spacing,background-position等屬性;
          
          3、percentage:真實(shí)的數(shù)字,如:word-spacing,width,vertical- align,top,right,bottom,left,min-width,min- height,max-width,max-height,line-height,height,background-position等屬性;
          
          4、integer 離散步驟(整個(gè)數(shù)字),在真實(shí)的數(shù)字空間,以及使用floor()轉(zhuǎn)換為整數(shù)時(shí)發(fā)生,如:outline-offset,z-index等屬性;
          
          5、number真實(shí)的(浮點(diǎn)型)數(shù)值,如:zoom,opacity,font-weight等屬性;
          
          6、transform list。
          
          7、rectangle:通過x、 y、 width和height(轉(zhuǎn)為數(shù)值)變換,如:crop;
          
          8、visibility:離散步驟,在0到1數(shù)字范圍之內(nèi),0表示“隱藏”,1表示完全“顯示”,如:visibility;
          
          9、shadow:作用于color、x、y、和blur(模糊)屬性,如:text-shadow;
          
          10、gradient:通過每次停止時(shí)的位置和顏色進(jìn)行變化。它們必須有相同的類型(放射狀的或是線性的)和相同的停止數(shù)值以便執(zhí)行動(dòng)畫,如:background-image;
          
          11、paint server (SVG):只支持下面的情況:從gradient到gradient以及color到color,然后工作與上面類似;
          
          12、space-separated list of above:如果列表有相同的項(xiàng)目數(shù)值,則列表每一項(xiàng)按照上面的規(guī)則進(jìn)行變化,否則無變化;
          
          13、a shorthand property:如果縮寫的所有部分都可以實(shí)現(xiàn)動(dòng)畫,則會(huì)像所有單個(gè)屬性變化一樣變化。
          #支持執(zhí)行transition效果的屬性
          
          Property Name    Type
          background-color    as color
          background-position    as repeatable list of simple list of length, percentage, or calc
          border-bottom-color    as color
          border-bottom-width    as length
          border-left-color    as color
          border-left-width    as length
          border-right-color    as color
          border-right-width    as length
          border-spacing    as simple list of length
          border-top-color    as color
          border-top-width    as length
          bottom    as length, percentage, or calc
          clip    as rectangle
          color    as color
          font-size    as length
          font-weight    as font weight
          height    as length, percentage, or calc
          left    as length, percentage, or calc
          letter-spacing    as length
          line-height    as either number or length
          margin-bottom    as length
          margin-left    as length
          margin-right    as length
          margin-top    as length
          max-height    as length, percentage, or calc
          max-width    as length, percentage, or calc
          min-height    as length, percentage, or calc
          min-width    as length, percentage, or calc
          opacity    as number
          outline-color    as color
          outline-width    as length
          padding-bottom    as length
          padding-left    as length
          padding-right    as length
          padding-top    as length
          right    as length, percentage, or calc
          text-indent    as length, percentage, or calc
          text-shadow    as shadow list
          top    as length, percentage, or calc
          vertical-align    as length
          visibility    as visibility
          width    as length, percentage, or calc
          word-spacing    as length
          z-index    as integer


          鼠標(biāo)放在以下圖片上,There will be a miracle:

          <!DOCTYPE html>
          <html>
          <head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
              <title>nick</title>
              <meta charset="utf-8" />
              <style type="text/css">
                  .img-see-2016-7-2 {
                      background-image: url("http://images.cnblogs.com/cnblogs_com/suoning/845162/o_sea.jpg");
                      background-size: 660px;
                      background-repeat: no-repeat;
                      height: 300px;
                      width: 600px;
          
                      transition-duration: 30s;
                      transition-timing-function: ease;
                      transition-property: background-size;
                  }
                  .img-see-2016-7-2:hover {
                      background-size: 2000px;
                  }
              </style>
          </head>
          <body>
              <div class="img-see-2016-7-2"></div>
          </body>
          </html>

          作者:suoning

          原文鏈接:https://www.cnblogs.com/suoning/p/5625582.html

          /準(zhǔn)備echarts腳本文件

          官網(wǎng)下載最新版本:https://echarts.apache.org/zh/download.html

          開源庫下載:https://cdn.jsdelivr.net/npm/echarts@5.3.3/dist/echarts.min.js

          //5.33改成最新版本的版本號(hào) 就可以下載最新版本了

          下載第三方水球庫插件:https://github.com/ecomfe/echarts-liquidfill

          1. 打開軟件 新建一個(gè)頁面 添加一個(gè)容器組件 用于綁定圖表對(duì)象 組件名稱隨便填寫 后面要用到

          2.添加一個(gè)事件來加載圖表腳本,我用的的頁面加載時(shí) ,也可以添加后臺(tái)服務(wù)組件,通過后臺(tái)服務(wù)組件事件:服務(wù)響應(yīng)時(shí)來調(diào)用腳本 可以很方便的綁定數(shù)據(jù)

          3.添加剛才下載echarts腳本文件

          添加第三方水球插件:

          引入腳本

          一個(gè)簡(jiǎn)單的例子

          要?jiǎng)?chuàng)建液體填充圖表,您需要有一個(gè)類型為'liquidFill'. 一個(gè)基本選項(xiàng)可能是:

          option={ series: [{ type: 'liquidFill', data: [0.6] }] };

          多波

          很容易創(chuàng)建一個(gè)帶有多個(gè)波浪的液體填充圖表,或者表示多個(gè)數(shù)據(jù),或者提高圖表的視覺效果。

          option={ series: [{ type: 'liquidFill', data: [0.6, 0.5, 0.4, 0.3]}]};

          這將在 60%、50%、40% 和 30% 的位置創(chuàng)建一個(gè)帶有波浪的圖表。

          顏色和不透明度

          要為液體填充圖表系列設(shè)置顏色,請(qǐng)?jiān)O(shè)置color為顏色數(shù)組。要設(shè)置不透明度,請(qǐng)使用itemStyle.opacity和itemStyle.emphasis.opacity用于普通樣式和懸停樣式。

          option={ series: [{ type: 'liquidFill', data: [0.5, 0.4, 0.3], color: ['red', '#0f0', 'rgb(0, 0, 255)'], itemStyle: { opacity: 0.6 }, emphasis: { itemStyle: { opacity: 0.9 } } }] };

          您還可以通過以下方式設(shè)置單個(gè)數(shù)據(jù)項(xiàng)的顏色和不透明度:

          option={ series: [{ type: 'liquidFill', data: [0.5, 0.4, { value: 0.3, itemStyle: { color: 'red', opacity: 0.6 }, emphasis: { itemStyle: { opacity: 0.9 } } }] }] };

          靜波

          為了防止波浪向左或向右移動(dòng),您可以簡(jiǎn)單地設(shè)置waveAnimation為false。要禁用波浪上升的動(dòng)畫,請(qǐng)將animationDuration和設(shè)置animationDurationUpdate為 0。

          option={ series: [{ type: 'liquidFill', waveAnimation: false, animationDuration: 0, animationDurationUpdate: 0, data: [0.6, 0.5, 0.4, 0.3] }] };

          靜止波

          您可以將 設(shè)置amplitude為 0 以產(chǎn)生靜止波。

          option={ series: [{ type: 'liquidFill', data: [0.6, 0.5, 0.4, 0.3], amplitude: 0, waveAnimation: 0 }] };

          在這種情況下建議設(shè)置waveAnimation為 false 以禁用動(dòng)畫以考慮性能。

          改變單個(gè)波

          要更改單個(gè)波形,請(qǐng)覆蓋數(shù)據(jù)項(xiàng)中的選項(xiàng)。

          option={ series: [{ type: 'liquidFill', data: [0.6, { value: 0.5, direction: 'left', itemStyle: { color: 'red' } }, 0.4, 0.3] }] };

          背景樣式

          您可以使用 backgroundStyle 選項(xiàng)來設(shè)置背景形狀的筆觸、填充樣式。

          option={ series: [{ type: 'liquidFill', data: [0.6, 0.5, 0.4, 0.3], backgroundStyle: { borderWidth: 5, borderColor: 'red', color: 'yellow' } }] };

          輪廓樣式

          要隱藏輪廓,只需設(shè)置outline.show為false。

          option={ series: [{ type: 'liquidFill', data: [0.6, 0.5, 0.4, 0.3], outline: { show: false } }] };

          形狀

          水填充圖表的形狀。有可能:

          • //默認(rèn)形狀:'circle',圓形 'rect'正方形, 'roundRect'圓角正方形, 'triangle'三角形, 'diamond'菱形, 'pin'氣球形, 'arrow'多邊三角形;
          • 'container':完全填滿容器的形狀。
          • 'path://'以.開頭的 SVG 路徑
          options=[{ series: [{ type: 'liquidFill', data: [0.6, 0.5, 0.4, 0.3], shape: 'diamond' }] }];

          option={
              series: [{
                  type: 'liquidFill',
                  data: [0.5, 0.4, 0.3, 0.2],
                  shape: 'container',
                  outline: {
                      show: false
                  }
              }]
          };

          option={ series: [{ type: 'liquidFill', data: [0.6, 0.55, 0.4, 0.25], radius: '60%', outline: { show: false }, backgroundStyle: { borderColor: '#156ACF', borderWidth: 1, shadowColor: 'rgba(0, 0, 0, 0.4)', shadowBlur: 20 }, shape: 'path://M367.855,428.202c-3.674-1.385-7.452-1.966-11.146-1.794c0.659-2.922,0.844-5.85,0.58-8.719 c-0.937-10.407-7.663-19.864-18.063-23.834c-10.697-4.043-22.298-1.168-29.902,6.403c3.015,0.026,6.074,0.594,9.035,1.728 c13.626,5.151,20.465,20.379,15.32,34.004c-1.905,5.02-5.177,9.115-9.22,12.05c-6.951,4.992-16.19,6.536-24.777,3.271 c-13.625-5.137-20.471-20.371-15.32-34.004c0.673-1.768,1.523-3.423,2.526-4.992h-0.014c0,0,0,0,0,0.014 c4.386-6.853,8.145-14.279,11.146-22.187c23.294-61.505-7.689-130.278-69.215-153.579c-61.532-23.293-130.279,7.69-153.579,69.202 c-6.371,16.785-8.679,34.097-7.426,50.901c0.026,0.554,0.079,1.121,0.132,1.688c4.973,57.107,41.767,109.148,98.945,130.793 c58.162,22.008,121.303,6.529,162.839-34.465c7.103-6.893,17.826-9.444,27.679-5.719c11.858,4.491,18.565,16.6,16.719,28.643 c4.438-3.126,8.033-7.564,10.117-13.045C389.751,449.992,382.411,433.709,367.855,428.202z', label: { position: ['38%', '40%'], formatter: function() { return 'ECharts\nLiquid Fill'; }, fontSize: 40, color: '#D94854' } }] };

          動(dòng)畫

          一般來說,液體填充圖表中有兩種類型的動(dòng)畫。
          第一種是初始動(dòng)畫,具有升浪的效果。此動(dòng)畫的緩動(dòng)方法由 控制,animationEasing其持續(xù)時(shí)間由控制animationDuration。
          第二種是更新動(dòng)畫,通常在數(shù)據(jù)變化、波高變化時(shí)使用。它們由animationEasingUpdate和控制animationDurationUpdate。
          例如,要禁用提升動(dòng)畫并將更新動(dòng)畫時(shí)間設(shè)置為 2 秒cubicOut,可以使用以下選項(xiàng):

          var mytubiao=echarts.init(document.getElementById("mytb"))

          option={
          series: [{
          type: 'liquidFill',
          data: [0.6, 0.5, 0.4, 0.3],
          animationDuration: 0,
          animationDurationUpdate: 2000,
          animationEasingUpdate: 'cubicOut'
          }]
          };
          mytubiao.setOption(option);
          setTimeout(function () {
          mytubiao.setOption({
          series: [{
          type: 'liquidFill',
          data: [0.8, 0.6, 0.4, 0.2]
          }]
          })
          }, 3000);

          更改文本

          默認(rèn)情況下,液體填充圖表的文本標(biāo)簽顯示第一個(gè)數(shù)據(jù)的百分比。例如,對(duì)于帶有 data 的圖表[0.6, 0.5, 0.4, 0.3],默認(rèn)文本是60%.

          要更改文本,您可以使用label.formatter,它可以設(shè)置為字符串或函數(shù)。

          如果是字符串,{a}則表示系列名稱、數(shù)據(jù)名稱和{c}數(shù)據(jù)值。

          option={ series: [{ type: 'liquidFill', name: 'Liquid Fill', data: [{ name: 'First Data', value: 0.6 }, 0.5, 0.4, 0.3], label: { formatter: '{a}\n\nValue: {c}', fontSize: 28 } }] };
          此示例的標(biāo)簽文本為'Liquid Fill\nFirst Data\nValue: 0.6'.

          formatter這與作為函數(shù)使用的結(jié)果相同:

          option={ series: [{ type: 'liquidFill', name: 'Liquid Fill', data: [{ name: 'First Data', value: 0.6 }, 0.5, 0.4, 0.3], label: { formatter: function(param) { return param.seriesName + '\n' + param.name + '\n' + 'Value:' + param.value; }, fontSize: 28 } }] };
          文本位置默認(rèn)在中心。label.position可以設(shè)置為'inside', 'left', 'right', 'top', 'bottom', 或水平和垂直位置,例如['10%', '20%'],表示'10%'向左(由 控制label.align,可以是'left'、'center'或'right')和'20%'頂部(由 控制label.baseline,可以是'top'、'middle'或'bottom')。
          陰影
          默認(rèn)情況下,波浪和輪廓上有陰影。以下是如何更改它們。

          option={ series: [{ type: 'liquidFill', data: [0.6, 0.5, 0.4, 0.3], itemStyle: { shadowBlur: 0 }, outline: { borderDistance: 0, itemStyle: { borderWidth: 5, borderColor: '#156ACF', shadowBlur: 20, shadowColor: 'rgba(255, 0, 0, 1)' } } }] };

          工具提示

          添加工具提示:
          option={ series: [{ type: 'liquidFill', data: [0.6], name: 'Liquid Fill' }], tooltip: { show: true } };

          點(diǎn)擊事件

          要在 wave 上添加點(diǎn)擊事件:

          chart.setOption(option); chart.on('click', function() { console.log(arguments); // do something useful here });

          與任何其他圖表類型一樣,上述代碼只會(huì)觸發(fā)波事件。如果要跟蹤整個(gè)畫布或特定元素上的事件,可以將偵聽器添加到 zrender,例如:

          chart.getZr().on('click', function() { console.log(arguments); });

          不可交互

          要使元素(例如,波浪)不可交互,只需設(shè)置silent為true.

          option={ series: [{ type: 'liquidFill', data: [0.6, 0.5, 0.4, 0.3], silent: true }] };

          API

          液體填充圖表的默認(rèn)選項(xiàng)是:

          {

          data: [],

          color: ['#294D99', '#156ACF', '#1598ED', '#45BDFF'],

          center: ['50%', '50%'],

          radius: '50%',

          amplitude: '8%',

          waveLength: '80%',

          phase: 'auto',

          period: 'auto',

          direction: 'right',

          shape: 'circle',

          waveAnimation: true,

          animationEasing: 'linear',

          animationEasingUpdate: 'linear',

          animationDuration: 2000,

          animationDurationUpdate: 1000,

          outline: {

          show: true,

          borderDistance: 8,

          itemStyle: {

          color: 'none',

          borderColor: '#294D99',

          borderWidth: 8,

          shadowBlur: 20,

          shadowColor: 'rgba(0, 0, 0, 0.25)'

          }

          },

          backgroundStyle: {

          color: '#E3F7FF'

          },

          itemStyle: {

          opacity: 0.95,

          shadowBlur: 50,

          shadowColor: 'rgba(0, 0, 0, 0.4)'

          },

          label: {

          show: true,

          color: '#294D99',

          insideColor: '#fff',

          fontSize: 50,

          fontWeight: 'bold',

          align: 'center',

          baseline: 'middle'

          position: 'inside'

          },

          emphasis: {

          itemStyle: {

          opacity: 0.8

          }

          }

          }

          數(shù)據(jù){(數(shù)字|對(duì)象)[]}

          每個(gè)數(shù)據(jù)項(xiàng)的值應(yīng)介于 0 和 1 之間。

          數(shù)據(jù)項(xiàng)也可以是配置單個(gè)項(xiàng)的選項(xiàng)的對(duì)象。

          option={

          series: [{

          type: 'liquidFill',

          data: [0.6, {

          value: 0.5,

          itemStyle: {

          color: 'red'

          }

          }, 0.4, 0.3]

          }]

          };

          這定義了具有第二波紅色的圖表。

          顏色 {string[]}

          波浪顏色。

          形狀 {字符串}

          水填充圖表的形狀。它可以是默認(rèn)符號(hào)之一:'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'. 或者,以 . 開頭的 SVG 路徑'path://'。

          中心{字符串[]}

          圖表的位置。第一個(gè)值是 x 位置,第二個(gè)值是 y 位置。每個(gè)值都可以是一個(gè)相對(duì)值,例如'50%',它是相對(duì)于容器寬度和高度的較小值的,也可以是一個(gè)絕對(duì)值,例如100px。

          半徑 {字符串}

          圖表的半徑,可以是相對(duì)值,如'50%',相對(duì)于容器寬度和高度的較小值,也可以是絕對(duì)值,如100px。

          幅度{數(shù)}

          波的幅度,以像素或百分比為單位。如果它是百分比,它是相對(duì)于直徑的。

          波長(zhǎng) {字符串|數(shù)字}

          波的波長(zhǎng),可以是相對(duì)值,例如'50%',它是相對(duì)于直徑的,也可以是絕對(duì)值,例如'100px'或100。

          階段{編號(hào)}

          波的相位,以弧度表示。默認(rèn)情況下'auto',當(dāng)每個(gè)波的相位Math.PI / 4大于前一個(gè)時(shí),它被設(shè)置為 。

          周期 {number|'auto'|function}

          向前移動(dòng)一個(gè)波長(zhǎng)所需的毫秒數(shù)。默認(rèn)情況下,'auto'當(dāng)前面的波速度較大時(shí),它被設(shè)置為 。

          它也可以是格式化程序功能。

          option={

          series: [{

          type: 'liquidFill',

          data: [0.6, 0.5, 0.4, 0.3],

          radius: '70%',

          phase: 0,

          period: function (value, index) {

          // This function is called four times, each for a data item in series.

          // `value` is 0.6, 0.5, 0.4, 0.3, and `index` is 0, 1, 2, 3.

          return 2000 * index + 1000;

          }

          }]

          }

          方向 {字符串}

          波浪移動(dòng)的方向,應(yīng)該是'right'或'left'。

          waveAnimation {boolean}

          是否啟用向左或向右移動(dòng)的波浪。

          動(dòng)畫緩動(dòng) {字符串}

          初始動(dòng)畫的緩動(dòng)方法,當(dāng)波浪從底部開始上升時(shí)。

          animationEasingUpdate {字符串}

          其他動(dòng)畫的緩動(dòng)方法,例如,當(dāng)數(shù)據(jù)值改變和波浪位置改變時(shí)。

          動(dòng)畫持續(xù)時(shí)間 {數(shù)字}

          初始動(dòng)畫持續(xù)時(shí)間,以毫秒為單位。

          animationDurationUpdate {數(shù)字}

          其他動(dòng)畫持續(xù)時(shí)間,以毫秒為單位。

          大綱.show {布爾}

          是否顯示輪廓。

          大綱.borderDistance {number}

          邊界和內(nèi)圈之間的距離。

          outline.itemStyle.borderColor {字符串}

          邊框顏色。

          outline.itemStyle.borderWidth {number}

          邊框?qū)挾取?/p>

          outline.itemStyle.shadowBlur {number}

          輪廓陰影模糊大小。

          outline.itemStyle.shadowColor {字符串}

          輪廓陰影顏色。

          backgroundStyle.color {字符串}

          背景填充顏色。

          backgroundStyle.borderWidth {字符串}

          背景描邊線寬。

          backgroundStyle.borderColor {字符串}

          背景描邊線寬。

          backgroundStyle.itemStyle.shadowBlur {number}

          背景陰影模糊大小。

          backgroundStyle.itemStyle.shadowColor {字符串}

          背景陰影顏色。

          backgroundStyle.itemStyle.opacity {number}

          背景不透明度。

          itemStyle.opacity {number}

          波浪不透明度。

          itemStyle.shadowBlur {number}

          波浪陰影寬度。

          itemStyle.shadowColor {字符串}

          波浪陰影顏色。

          強(qiáng)調(diào).itemStyle.opacity {number}

          懸停時(shí)波浪不透明度。

          標(biāo)簽.show {布爾}

          是否顯示標(biāo)簽文本。

          label.color {字符串}

          在背景上顯示時(shí)文本的顏色。

          label.insideColor {字符串}

          在波形上顯示時(shí)文本的顏色。

          label.fontSize {數(shù)字}

          標(biāo)簽字體大小。

          標(biāo)簽.fontWeight {字符串}

          標(biāo)簽字體粗細(xì)。

          標(biāo)簽對(duì)齊{字符串}

          文本對(duì)齊,應(yīng)該是'left', 'center', 或'right'.

          label.baseline {字符串}

          文本垂直對(duì)齊,應(yīng)為'top'、'middle'或'bottom'。

          標(biāo)簽位置 {string|string[]}

          文本位置默認(rèn)在中心。label.position可以設(shè)置為'inside', 'left', 'right', 'top', 'bottom', 或水平和垂直位置,例如['10%', '20%'],表示'10%'左側(cè)和'20%'頂部。


          主站蜘蛛池模板: 国产av夜夜欢一区二区三区| 久久久久人妻精品一区三寸蜜桃 | 久久99精品免费一区二区| 国产精品视频一区二区三区不卡| 国产一区二区三区在线观看免费 | 无码播放一区二区三区| www.亚洲一区| 国产一区二区中文字幕| 国产免费一区二区三区| 精品一区二区三区在线播放| 国产福利一区二区在线视频 | 国产美女精品一区二区三区| 久久精品午夜一区二区福利 | 亚洲狠狠狠一区二区三区| 性色AV一区二区三区天美传媒| 日本精品一区二区三区四区| 国产主播一区二区| 免费无码A片一区二三区| 国产精品成人国产乱一区| 久久久无码一区二区三区| 国产亚洲综合一区二区三区| 最美女人体内射精一区二区| 亚洲综合色一区二区三区| 精品国产AⅤ一区二区三区4区 | 91精品一区二区三区在线观看| 日韩伦理一区二区| 亚洲视频一区调教| 一区二区精品在线观看| 亚洲Av无码一区二区二三区| 午夜福利国产一区二区| 国产福利91精品一区二区| 亚洲一区二区三区乱码A| 国产一区在线mmai| 免费观看一区二区三区| 国产视频福利一区| 日韩精品一区二区三区中文精品| 香蕉视频一区二区| 国产精品99精品一区二区三区| 亚洲色精品aⅴ一区区三区| 精品视频在线观看一区二区三区| 末成年女A∨片一区二区|