<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題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關鍵字專題關鍵字專題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
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        jQuery實現撲克正反面翻牌效果實例分享

        來源:懂視網 責編:小OO 時間:2020-11-27 20:05:07
        文檔

        jQuery實現撲克正反面翻牌效果實例分享

        效果圖。代碼如下:<。=';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}。相關推薦。CSS3實現動態翻牌效果。3D翻牌的10篇內容推薦。jQuery實現個性翻牌效果導航菜單的方法_jquery。
        推薦度:
        導讀效果圖。代碼如下:<。=';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}。相關推薦。CSS3實現動態翻牌效果。3D翻牌的10篇內容推薦。jQuery實現個性翻牌效果導航菜單的方法_jquery。
        本文主要介紹了jQuery實現撲克正反面翻牌效果的實例。具有很好的參考價值。下面跟著小編一起來看下吧,希望能幫助到大家。

        效果圖:

        代碼如下:

        <!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布局提示:背面默認隱藏 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布局提示:背面默認隱藏 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' 判斷鼠標移入移出
         @speed: 速度 不填默認速度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) { 
         /*配置參數*/
         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;/*默認速度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不填默認速度80 建議不要超過100*/
        /*插件引用方法x*/
        $('.demo2').OverTurn('x');
        </script>
        </body>
        </html>

        相關推薦:

        CSS3實現動態翻牌效果

        3D翻牌的10篇內容推薦

        jQuery實現個性翻牌效果導航菜單的方法_jquery

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

        文檔

        jQuery實現撲克正反面翻牌效果實例分享

        效果圖。代碼如下:<。=';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}。相關推薦。CSS3實現動態翻牌效果。3D翻牌的10篇內容推薦。jQuery實現個性翻牌效果導航菜單的方法_jquery。
        推薦度:
        標簽: 分享 實現 效果
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲国产激情一区二区三区| 白白国产永久免费视频| 亚洲美女又黄又爽在线观看| 在线精品自拍亚洲第一区| 国产成人精品123区免费视频| 亚洲AV一二三区成人影片| 18勿入网站免费永久| 7777久久亚洲中文字幕| 特级淫片国产免费高清视频| 亚洲aⅴ无码专区在线观看春色| 国产色爽免费视频| 黄色免费网址在线观看| 夜夜春亚洲嫩草影院| 一级毛片免费毛片一级毛片免费 | 又粗又长又爽又长黄免费视频 | 中文字幕无码亚洲欧洲日韩| 中文字幕无码成人免费视频| 亚洲日本一线产区和二线| 在线永久免费观看黄网站| 九一在线完整视频免费观看| 亚洲中文字幕无码永久在线| 国产麻豆一精品一AV一免费 | 911精品国产亚洲日本美国韩国| 日本免费一区二区在线观看| 亚洲欧美日韩中文二区| 亚洲国产精品一区二区三区久久 | 7x7x7x免费在线观看| 亚洲日韩久久综合中文字幕| 日韩精品电影一区亚洲| 无码一区二区三区免费| 亚洲色偷偷偷综合网| 久久亚洲AV无码西西人体| 免费人妻无码不卡中文字幕系| 亚洲大成色www永久网址| 亚洲?v无码国产在丝袜线观看 | 亚洲av无一区二区三区| 亚洲中文字幕在线观看| 免费看国产成年无码AV片| 一级免费黄色毛片| 亚洲不卡视频在线观看| 久久精品国产亚洲7777|