CSS實現二維碼掃描的效果


掃描二維碼的效果,我原以為不好寫呢,后來想了想其實挺簡單的,幾行代碼,走起

<div class="code-bg">
    <div class="line"></div>
</div>
.code-bg{
		    position: relative; 
		    height: 200px; width: 200px; 
		    margin: 0px auto;/*此處為了居中*/
		    background: url(img/ewm1.jpg) center top no-repeat; /*二維碼*/
		}
		.line{ 
		    position: absolute; 
		    left: -80px; 
		    z-index: 2; 
		    height: 3px; width: 360px; 
		    background: url(img/share/dapai.png) no-repeat; /*上下掃的線*/
		    /*動畫效果*/
		    animation: myScan 1s infinite alternate; 
		    -webkit-animation: myScan 1s infinite alternate; 
		}
		@keyframes  myScan{
		    from { top:0px; }
		    to { top: 197px; }
		}
		-webkit-@keyframes  myScan{
		    from { top:0px; }
		    to { top: 197px; }
		}

  我這里不方便截圖,那就這樣吧,是不是很簡單。這樣就實現了

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM