jQuery實(shí)現(xiàn)的指紋掃描效果實(shí)例(附演示與demo源碼下載)
本文實(shí)例講述了jQuery實(shí)現(xiàn)的指紋掃描效果。分享給大家供大家參考,具體如下:
運(yùn)行效果截圖如下:

點(diǎn)擊此處查看在線演示效果。
具體代碼如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>demo</title>
<style type="text/css">
body {
background:black;
}
.dialog {
width:300px; height:300px; position:fixed; left:50%; margin-left:-150px; border:2px dashed green;
top:50px;
}
.dialog .shape {
background:black; width:300px; height:300px; z-index:1;
}
.dialog .eye {
width:200px; height:200px; position:absolute; left:50px; top:50px;
z-index:2;
}
#container {
position:relative;
}
.line {
position:absolute; left:0px; top:0px; font-size:0px; z-index:10;
background:green;
}
.btnGroup {
text-align:center;
}
.btnGroup button {
width:50px; height:40px;
}
.dialog.output {
top:400px; display:none;
}
#power {
border:1px solid green; position:fixed; right:20px; bottom:20px;
color:green; line-height:50px; font-size:30px;
}
.title {
line-height:50px; font-size:25px; color:#8F8383; text-shadow:0px 0px 3px green;
text-align:center;
}
</style>
</head>
<body>
<div class="dialog">
<div id="container">
<div class="shape"></div>
<img src="finger.png" class="eye" />
</div>
<div class="btnGroup">
<button id="vSee">豎向掃描</button>
<button id="hSee">橫向掃描</button>
<button id="bSee">雙向掃描</button>
<button id="dSee">深度掃描</button>
</div>
</div>
<div class="dialog output" id="outputContainer">
<img src="finger.png" class="eye" />
</div>
</body>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
var container = $("#container");
var outputContainer = $("#outputContainer");
function Line(type) {
var self = this;
self.type = type || "V";
var body = $("<div class='line'></div>");
switch(this.type) {
case "V": // 豎直
body.css({
"width": "1px",
"height": "300px"
});
break;
case "H": // 水平
body.css({
"width": "300px",
"height": "1px"
});
break;
}
container.append(body);
self.body = body;
self.direct = self.type === "V" ? "R" : "B";
self.run = function() {
switch(self.direct) {
case "L":
self.body.animate({"left":0}, 1000, null, function() {
self.direct = "R";
self.run();
});
break;
case "R":
self.body.animate({"left":300}, 1000, null, function() {
self.direct = "L";
self.run();
});
break;
case "T":
self.body.animate({"top":0}, 1000, null, function() {
self.direct = "B";
self.run();
});
break;
case "B":
self.body.animate({"top":300}, 1000, null, function() {
self.direct = "T";
self.run();
});
break;
}
}
self.run();
}
var lineArray = [];
function output(type, time, opactiy) {
time = time || 2000;
var initHeight = type === "H" ? 0 : 300;
var initWidth = type === "H" ? 300 : 0;
type === "B" && (initHeight = initWidth = 0);
outputContainer.css({
"height": initHeight,
"width": initWidth,
"display": "block",
"opacity": opactiy || 1
});
outputContainer.animate({"height":300, "width":300}, time, null);
}
function clear() {
for(var i=0, len=lineArray.length; i<len; i++) {
var line = lineArray[i];
line.body.stop().remove();
}
container.find(".line").remove();
outputContainer.stop().css({"display": "none", "opacity": 0});
}
$("#hSee").click(function() {
clear();
lineArray.push(new Line("H"));
output("H", null, 0.5);
});
$("#vSee").click(function() {
clear();
lineArray.push(new Line("V"));
output("V", null, 0.5);
});
$("#bSee").click(function() {
clear();
lineArray.push(new Line("H"), new Line("V"));
output("B", 3500, 0.8);
});
$("#dSee").click(function() {
clear();
for(var i=0; i<5; i++) {
(function(index) {
setTimeout(function() {
lineArray.push(new Line("H"), new Line("V"));
}, index*200);
})(i);
}
output("B", 5000, 1.0);
});
</script>
</html>
完整實(shí)例代碼點(diǎn)擊此處本站下載。
更多關(guān)于jQuery特效相關(guān)內(nèi)容感興趣的讀者可查看本站專(zhuān)題:《jQuery動(dòng)畫(huà)與特效用法總結(jié)》及《jQuery常見(jiàn)經(jīng)典特效匯總》
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
- android 指紋識(shí)別調(diào)用實(shí)現(xiàn)方法及示例代碼
- Android 指紋識(shí)別詳解及實(shí)現(xiàn)方法
- Android中的指紋識(shí)別demo開(kāi)發(fā)實(shí)例
- 淺析IOS開(kāi)發(fā)TouchID指紋解鎖功能
- Android指紋識(shí)別API初試
- Android獲取apk簽名指紋的md5值(防止重新被打包)的實(shí)現(xiàn)方法
- 使用Swift代碼實(shí)現(xiàn)iOS手勢(shì)解鎖、指紋解鎖實(shí)例詳解
- 使用TCP/IP協(xié)議棧指紋進(jìn)行遠(yuǎn)程操作系統(tǒng)辨識(shí)
- Android 6.0指紋識(shí)別App開(kāi)發(fā)案例
相關(guān)文章
jquery實(shí)現(xiàn)圖片漸變切換兼容ie6/Chrome/Firefox
jquery代碼實(shí)現(xiàn)圖片漸變切換同時(shí)兼容ie6、Chrome、Firefox,想學(xué)習(xí)的朋友可以測(cè)試下,希望對(duì)大家有所幫助2013-08-08
JQuery FlexiGrid的asp.net完美解決方案 dotNetFlexGrid-.Net原生的異步表格控件
dotNetFlexGrid是一款dotNet原生的異步表格控件,他的前身是Jquery FlexiGrid插件,我們重構(gòu)了FlexiGrid的大部分Javascript代碼,使其工作的更有效率,BUG更少;同時(shí)將其封裝為dotNet控件,提供了簡(jiǎn)單易用的使用方式。2010-09-09
jquery實(shí)現(xiàn)上傳文件進(jìn)度條
這篇文章主要為大家詳細(xì)介紹了jquery實(shí)現(xiàn)上傳文件進(jìn)度條,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-03-03
jquery ztree實(shí)現(xiàn)下拉樹(shù)形框使用到了json數(shù)據(jù)
項(xiàng)目需要用到樹(shù)形下拉框,采用了zTree來(lái)實(shí)現(xiàn),因?yàn)榇a的移植性比較高,下面是實(shí)現(xiàn)的代碼2014-05-05
JQ獲取動(dòng)態(tài)加載的圖片大小的正確方法分享
這篇文章介紹了JQ獲取動(dòng)態(tài)加載的圖片大小的正確方法,有需要的朋友可以參考一下2013-11-11
jquery 關(guān)于event.target使用的幾點(diǎn)說(shuō)明介紹
本篇文章介紹了,jquery中關(guān)于event.target使用的幾點(diǎn)說(shuō)明。需要的朋友參考下2013-04-04
jQuery實(shí)現(xiàn)點(diǎn)擊小圖顯示大圖代碼分享
這篇文章主要介紹了jQuery實(shí)現(xiàn)點(diǎn)擊小圖顯示大圖效果,功能實(shí)現(xiàn)非常簡(jiǎn)單,推薦給大家,有需要的小伙伴可以參考下。2015-08-08

