国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

jQuery實現(xiàn)撲克正反面翻牌效果實例分享

來源:懂視網(wǎng) 責(zé)編:小OO 時間:2020-11-27 20:05:07
文檔

jQuery實現(xiàn)撲克正反面翻牌效果實例分享

效果圖。代碼如下:<。=';x';&& direction,width: 0},speed.function() { $front.hide();$behind.show().animate({left: 0,width: dis},speed);});}else{ $front.animate({top: dis/2,height: 0},speed.function() { $front.hide();$behind.show().animate({top: 0,height: dis}。相關(guān)推薦。CSS3實現(xiàn)動態(tài)翻牌效果。3D翻牌的10篇內(nèi)容推薦。jQuery實現(xiàn)個性翻牌效果導(dǎo)航菜單的方法_jquery。
推薦度:
導(dǎo)讀效果圖。代碼如下:<。=';x';&& direction,width: 0},speed.function() { $front.hide();$behind.show().animate({left: 0,width: dis},speed);});}else{ $front.animate({top: dis/2,height: 0},speed.function() { $front.hide();$behind.show().animate({top: 0,height: dis}。相關(guān)推薦。CSS3實現(xiàn)動態(tài)翻牌效果。3D翻牌的10篇內(nèi)容推薦。jQuery實現(xiàn)個性翻牌效果導(dǎo)航菜單的方法_jquery。
本文主要介紹了jQuery實現(xiàn)撲克正反面翻牌效果的實例。具有很好的參考價值。下面跟著小編一起來看下吧,希望能幫助到大家。

效果圖:

代碼如下:

<!DOCTYPE>
<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>【JQuery插件】撲克正反面翻牌效果</title>
 <style>
 *{margin:0px;padding:0px;list-style:none;font-size: 16px;}
 </style>
 </head>
 <body>
 <style>
 .demo1 {margin:10px; width: 200px;height: 100px;text-align: center;position: relative;}
 .demo1 .front{width: 200px;height: 100px;position:absolute;left:0px;top:0px;background-color: #000;color: #fff;}
 .demo1 .behind{width: 200px;height: 0px;position:absolute;left:0px;top:50px;background-color: #ccc;color: #000;display: none;}
 </style>
 <h1>demo1 y軸 (css布局提示:背面默認(rèn)隱藏 height為0 top是高度的一半也就是demo中間)</h1>
 <p class="demo1">
 <p class="front">正面正面正<br/>面正面正面<br/></p>
 <p class="behind">背面</p>
 </p>
 <p class="demo1">
 <p class="front">正面</p>
 <p class="behind">背面</p>
 </p>
 <style>
 .demo2 {margin:10px; width: 200px;height: 100px;text-align: center;position: relative;}
 .demo2 .front{width: 200px;z-index: 1; height: 100px;position:absolute;left:0px;top:0px;background-color: #000;color: #fff;}
 .demo2 .behind{width: 0;height: 100px;z-index: 0;position:absolute;left:100px;top:0;background-color: #ccc;color: #000;}
 </style>
 <h1>demo2 x軸(css布局提示:背面默認(rèn)隱藏 width為0 left是寬度的一半也就是demo中間)</h1>
 <p class="demo2">
 <p class="front">正面</p>
 <p class="behind">背面</p>
 </p>
 <p class="demo2">
 <p class="front">正面</p>
 <p class="behind">背面</p>
 </p>
<script type="text/javascript" src="http://static.cnmo-img.com.cn/js/jquery144p.js"></script>
<script>
(function($) {
 /*
 ====================================================
 【JQuery插件】撲克翻牌效果
 @auther LiuMing
 @blog http://www.cnblogs.com/dtdxrk/
 ====================================================
 @front:正面元素
 @behind:背面元素
 @direction:方向
 @dis:距離
 @mouse: 'enter' 'leave' 判斷鼠標(biāo)移入移出
 @speed: 速度 不填默認(rèn)速度80 建議不要超過100
 */
 var OverTurnAnimate = function(front, behind, direction, dis, mouse, speed){
 /*判斷移入移出*/
 var $front = (mouse == 'enter') ? front : behind,
 $behind = (mouse == 'enter') ? behind : front;
 $front.stop();
 $behind.stop();
 if(direction == 'x'){
 $front.animate({left: dis/2,width: 0},speed, function() {
 $front.hide();
 $behind.show().animate({left: 0,width: dis},speed);
 });
 }else{
 $front.animate({top: dis/2,height: 0},speed, function() {
 $front.hide();
 $behind.show().animate({top: 0,height: dis},speed);
 });
 }
 };
 /*
 @demo
 $('.demo1').OverTurn(@direction, @speed);
 @direction(String)必選 'y' || 'x' 方向
 @speed(Number)可選 速度
 */
 $.fn.OverTurn = function(direction, speed) { 
 /*配置參數(shù)*/
 if(direction!='x' && direction!='y'){throw new Error('OverTurn arguments error');}
 $.each(this, function(){
 var $this = $(this),
 $front = $this.find('.front'),
 $behind = $this.find('.behind'),
 dis = (direction=='x') ? $this.width() :$this.height(),
 s = Number(speed) || 80;/*默認(rèn)速度80 建議不要超過100*/
 $this.mouseenter(function() {
 OverTurnAnimate($front, $behind, direction, dis, 'enter', s);
 }).mouseleave(function() {
 OverTurnAnimate($front, $behind, direction, dis, 'leave', s);
 });
 });
 };
})(jQuery);
/*插件引用方法y*/
$('.demo1').OverTurn('y',100);/*speed不填默認(rèn)速度80 建議不要超過100*/
/*插件引用方法x*/
$('.demo2').OverTurn('x');
</script>
</body>
</html>

相關(guān)推薦:

CSS3實現(xiàn)動態(tài)翻牌效果

3D翻牌的10篇內(nèi)容推薦

jQuery實現(xiàn)個性翻牌效果導(dǎo)航菜單的方法_jquery

聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

jQuery實現(xiàn)撲克正反面翻牌效果實例分享

效果圖。代碼如下:<。=';x';&& direction,width: 0},speed.function() { $front.hide();$behind.show().animate({left: 0,width: dis},speed);});}else{ $front.animate({top: dis/2,height: 0},speed.function() { $front.hide();$behind.show().animate({top: 0,height: dis}。相關(guān)推薦。CSS3實現(xiàn)動態(tài)翻牌效果。3D翻牌的10篇內(nèi)容推薦。jQuery實現(xiàn)個性翻牌效果導(dǎo)航菜單的方法_jquery。
推薦度:
標(biāo)簽: 分享 實現(xiàn) 效果
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 国内一区亚洲综合图区欧美 | 亚洲欧美二区三区久本道 | 久久国产精品成人免费 | 永久免费观看的毛片的网站下载 | 欧美一区二区日韩一区二区 | 国产成人h片视频在线观看 国产超级乱淫片中文 | 日韩高清专区 | 精品国产综合成人亚洲区 | 国产第一页视频 | 91热久久| 夜色毛片永久免费 | 97伊人网 | 在线播放精品一区二区啪视频 | 美女一级毛片 | 亚洲永久精品一区二区三区 | 一级久久| 精品久久久久久久久中文字幕 | 国产在线视频不卡 | 亚洲欧洲精品成人久久曰 | 91大神在线精品视频一区 | 国产精品香蕉 | 国产欧美日韩第一页 | 国产精品视频自拍 | 一级毛片视频免费 | 91 久久 | 久草精品在线观看 | 精品一区二区三区视频日产 | 看全色黄大色黄女片爽毛片 | 一级一级一级毛片 | 国产免费自拍 | 欧美日韩 在线播放 | 在线观看亚洲专区 | 精品视频一区二区三区四区 | 六月丁香在线观看 | 国产日韩一区 | 91麻豆国产精品91久久久 | 国产亚洲一区二区三区在线观看 | 国产 日韩 欧美在线 | 天天做夜夜做久久做狠狠 | 久久精品国产999久久久 | 国产手机在线αⅴ片无码观看 |