国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ? ????? CSS ???? ???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??

???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??

Oct 22, 2018 am 11:58 AM
css css3 javascript

? ?? ??? ?? CSS? ???? ???? ??? ??? ????? ?? ??? ???? JS ?? ??? ?? ?????. ??? ??? ???? ??? ? ??? ????.

?? ???? ?? CSS? ???? ??? ?? ?????? ?????, ? ????? ??? ? ?? ??? ????. ?? ???? ???? ??? ?? ??? ?????. ??? ??? ?????? ? ? ?????. ? ??? ??? ? ??? ??? ?? ??? ???? ????.

?? ?? ??? ?? ?? ??? ?????

???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??

css? ?? ??? ??? ? ? ????

?? ? ?? js

?? CSS? ?? ??? ?? ??? ???, ??? UI ????? ????. ????? ??? ???? ????. ? CSS? ??? ??? ????.

???? ??? ? ?? ??? js? ???? ?? ??? ?? ? ??? js? ??? ?? ? ??? ??? ?? ?? ???? CSS? ??? ? ????.

?? ????

css? ??? ??

??? ???? CSS? ??? ??? ??? ???? js? ???? ??? ? ??? ?? CSS? ??? ? ????.

CSS ?? ?? var, ??? ???? ????. ??? ??? ?? ??? ???? ??? ????, ??? ???? ?? ???? ????

???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??

?? IE? ???? ?? ?? ???? ??? ?????. IE???? ??? ??? ????? ??? ? ??? ????? ??? ????. ??? ?? IE的話兼容性還是可以的,就算要兼顧IE,可以保證按鈕是完好的,只是沒有動畫效果不就可以了嗎,這也是所謂的優(yōu)雅降級

var的用法很簡單

:root?{
????--main-bg-color:?red;
}
.container?{
????width:?20px;
????height:?20px;
????background-color:?var(--main-bg-color);/**background-color:red**/
}

有關(guān)var的詳細用法,大家可以自行百度

全能js

我們用js只有一個目的,就是獲取鼠標點擊的位置

很簡單,事件對象event中有個offsetX和offsetY就是用來描述鼠標位置相對于父元素的位置

???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??

其實這個屬性早些年是IE私有的,谷歌和火狐看著好用,不知道從上面版本也都支持了,所以兼容性沒太大問題~

???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??

var?x?=?event.offsetX;
var?y?=?event.offsetY;

具體實現(xiàn)

我們需要在點擊的時候獲取到左邊,然后存在css變量中

示例代碼

function?ripple(ev){
??var?x?=?ev.offsetX;
??var?y?=?ev.offsetY;
??this.style.setProperty('--x',x+'px');
??this.style.setProperty('--y',y+'px');
}

沒錯,就這么一丁點js

相應(yīng)的css部分我們要拿到我們保存的變量,來改變中心點的位置

.btn>span:after{?
??content:?'';?
??position:?absolute;?
??background:?transparent;?
??border-radius:50%;?
??width:?100%;?
??padding-top:?100%;?
??margin-left:?-50%;?
??margin-top:?-50%;?
??left:?var(--x,-100%);?
??top:?var(--y,-100%);?
}

這里我們解決了兩個問題,

首次進來會觸發(fā)一次:這里我們把left給了一個默認值-100%

left:?var(--x,-100%);

也就是說,當前面的--x沒有值或者非法的時候就會取后面一個值,-100%??? ??????

??? ???. var? ???? ?? ?????

<label class="btn" tabindex="1">
<input type="checkbox"><span onclick="ripple(this,event)">button</span>
</label>

var? ??? ???? ??? Baidu? ?? ? ? ????

??? js

??? js? ??? ?? ??? ?? ? ? ?? ????? ?????.

?? ?????. ??? ?? ????? ?? ??? ???? ???? ??? ?????? ? ???? offsetX ? offsetY? ????. cn//upload/image/131/589/601/1540180271559462.png" title="1540180271559462.png" alt="???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ?? "/ >

?? ? ??? ?? ???? ?????? ???? ??? ????, ? ????? ?????? ? ????? ????? ? ??? ????~

???????? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??????
.btn{
 display: block; 
 width: 300px; 
 margin: 50px; 
 outline: 0; 
 overflow: hidden;  
 position: relative; 
 transition: .3s; 
 cursor: pointer; 
 user-select: none; 
 height: 100px; 
 text-align: center; 
 line-height: 100px; 
 font-size: 50px; 
 background: tomato; 
 color: #fff;  
 border-radius: 
 10px;
 }
.btn>span{
 position: absolute; 
 left: 0; top: 0; 
 width: 100%; 
 height: 100%;
 }
.btn>span:after{
 content: &#39;&#39;; 
 position: absolute; 
 background: transparent; 
 border-radius:50%; 
 width: 100%; 
 padding-top: 100%; 
 margin-left: -50%; 
 margin-top: -50%; 
 left: var(--x,-100%); 
 top: var(--y,-100%); 
 }
.btn:active{
 background: orangered;
 }
.btn>input[type=checkbox]{display: none}
.btn>input[type=checkbox]+span:after{animation: ripple-in 1s;}
.btn>input[type=checkbox]:checked+span:after{animation: ripple-out 1s;}
@keyframes ripple-in{
    from {
        transform: scale(0);
        background: rgba(0,0,0,.25)
    }
    to {
        transform: scale(1.5);
        background: transparent
    }
}
@keyframes ripple-out{
    from {
        transform: scale(0);
        background: rgba(0,0,0,.25)
    }
    to {
        transform: scale(1.5);
        background: transparent
    }
}
?? ?????? ?? ?? ??????? ???? ??? ??? ?? CSS ??? ??????????? ????
function ripple(dom,ev){
  console.log(ev)
  var x = ev.offsetX;
  var y = ev.offsetY;
  dom.style.setProperty(&#39;--x&#39;,x+&#39;px&#39;);
  dom.style.setProperty(&#39;--y&#39;,y+&#39;px&#39;);
}
???, js? ?? ?????????? CSS ???? ??? ????? ??? ??? ???? ???. ?? ?? ??rrreee????? ??? ? ?? ??? ??????. ??????? ?? ??? ? ? ? ????????: ???? left? ??? -100%? ??????. ??rrreee???, ?? --x? ?? ??? ??? ?? ?? ?? -100%? ?????. ??? ????? ????? ?? ?? ?? ???? ???? ?? ???? ????. ????????? ?? ??? ?? ????: ?? ??? ??? ????? ??? ?? ???? ???? ??? ?? ? ? ????.???????? ??????rrreeerrreeerrreee????section??????In ?? JS ??? ?? ???? CSS? ?????. CSS? JS?? ?? ?????. ?? ??? ?? ??, ?? ??? ??? ?? ??? ???? ?? ??? ???? ??? ?? ???? ??? ???? ?? ?? ??? ???? ?? ?? ????. ??? ???? ??? ????? ?? ??? ???? ???. ?? ????? ???? ??? ?? ?? ????, ????? ??? ??. ??????

? ??? ???? ??? ??? ????? ?? ??? ???? ?? CSS js ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
CSS?? ??? ??? ???? ??? CSS?? ??? ??? ???? ??? Jul 27, 2025 am 04:25 AM

CSS? ??? ??? ????? ?? ??? ???????. 1. ?? ??? ???? ??? ??? ???? ?? ?? (? : ???), 16 ? ?? (? : #FF0000), RGB ? (? : RGB (255,0,0)), HSL ? (? : HSL (0,100%, 50%) ? RGBA ?? HSLA (RGBA) (255,0.0); 2. H1 ~ H6 ??, ?? P, ?? A? ?? ???? ?? ? ?? ??? ??? ?? ? ? ???? (A : A : ??, A : ??, A : Active, Div, Span ?; 3. ???

???? ?? CSS? ???? ??? ???? ?? CSS? ???? ??? Jul 27, 2025 am 02:47 AM

USEAUTOMATEDTOOLSPURGECSSORUCNSSCANANDREMOVEUNUSEDCSS; 2. INTEGRATEPURGINGINTOYOURBUILDPROCESSVIAWEBPACK, vite, ortailwind'ScontentConfiguration; 3.auditcsSusagewithchromedevToolsCovereAvoidtoidrestyledingneatiledneatiled? 3.auditcsSusage

?? CSS ??? ????? ?????? ?? CSS ??? ????? ?????? Jul 27, 2025 am 04:24 AM

? ???? CSS ??? ??? ?? ?? ??? ?? ? ??? ?? ????. 1. ?? (px)? ?? ? ???? ?? ??? ???? ? ????? ?? ? ????? ????? ????. 2. ??? (%)? ?? ????? ?? ???? ???? ????? ????? ???? ??????? ?????. 3.EM? ?? ?? ??? ??????, REM? ?? ?? ??? ??????, ?? ?? ? ?? ?? ??? ?????. 4. ??? ?? (VW/VH/VMIN/VMAX)? ?? ??? ?? ???? ?? ?? ?? ? ?? UI? ?????. 5. ??, ??, ?? ? ?? ?? ???? ???? ??, ?? ?? ????? ? ????, ?? ???? ???? ? ??? ??? ??????. ??? ??? ???? ??? ??? ???? ?? ?? ???? ? ????.

??? ???? ? ?????? ??? ???? ? ?????? Jul 27, 2025 am 03:55 AM

astackingcontextiself-containdlayerincssthatcontrolsthez-orderofoverlappingElements, ???? wherenestedcontextsrestrictz-indexintermation;

CSS ?? ?? ??? ???? ??? ?????? CSS ?? ?? ??? ???? ??? ?????? Aug 02, 2025 pm 12:11 PM

?? ??? ?? ?? ??? ??? ??? ???? ? ?????. 1. ?? ?? : Blur (10px) ? ?? ??? ???? ???? ?? ??? ?????. 2. ??, ??, ?? ?? ?? ?? ?? ??? ???? ?? ? ? ????. 3. ?? ?? ???? ?? ???? ??? ??? ?????????. 4. ??? ????? ??? ??? @Supports? ?? ???? ???? ???? ? ??? ? ????. 5. ??? ????? ?? ??? ?? ?? ??? ?? ???? ?????. ? ??? ?? ?? ????? ???? ?????.

CSS? ??? ?????? ??? ?????? CSS? ??? ?????? ??? ?????? Jul 29, 2025 am 04:25 AM

??? ???? ?? ???? ?? ?? ??? ???????. 1. A ?? : ?? Unreached ?? ???? ???? ??, 2. A : ??? ? ??? ????? ??, 3. ?? ?? ??? ????? ??, 4 : ?? ?? ???? ????? ???. ??, ?? : ??? ? ??? ??? ????? ??? ???? ???? ???? ???? ? ????. ?? Border-Bottom ?? ????? ??? ???? ?? ??? ??? ??? ??? ??? ???? ??? ? ? ????.

CSS? ???? ???? ??? ?????? CSS? ???? ???? ??? ?????? Jul 27, 2025 am 03:16 AM

???-?? : ??? ???? ???? ?? ??? ?????. 2. Flexbox? ?? ??? ?????? : ?? ? ??? ??? : ?? ? ?? ???? ???? ?? ??; 3. ?? ?? ???? ???? ??? ??? ? ???? ???? ?? ??? ?? ? ????. 4. ?? ???? ??? ??? ?? ? ? ???? : 50%, ?? : 50%? ?? : ??? ???? ?? ?? (-50%, -50%); 5. CSSGRID? ?? ?? : ??? ??? ?? ? ??? ?? ? ? ????. ?? ?????? Flexbox ?? ???? ?? ???? ?? ????.

??? ???? ??? ?? ? ?????? ??? ???? ??? ?? ? ?????? Jul 31, 2025 am 10:35 AM

??? ???? ??? ??? ????? ???? ???? ?? CSS ??????. ??? ?? ???? ???? ?? HTML ??? ??? ????? ?? ? ????. ???? ?? ??? ??? ??? ? ?????? ????? ?????? ?????? ??? ? ????. ???? ?? ???? ?????? ??? ??? ??? ?????. ??? ??? ??? ?? ??? ??? ???? ?? ????????. ???? ???? ???? ?? ? ?? ?? ??, ?? ?? ??, ?? ?? ?? ? ?? ?? ???? ?????. ??? ???? ???? ???? ??? ???? ???? ????? ??? ???? ??? ???? ? ? ????.

See all articles