<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
        主站蜘蛛池模板: 91国内免费在线视频| 老司机精品视频免费| 亚洲伊人久久大香线蕉苏妲己| 亚洲精品无码午夜福利中文字幕 | 亚洲精品国产自在久久 | 青青草国产免费国产是公开| 中文字幕视频在线免费观看| 亚洲人成无码久久电影网站| 亚洲AV综合色区无码二区爱AV| 亚洲AV香蕉一区区二区三区| 怡红院免费全部视频在线视频| 亚洲精品天堂成人片?V在线播放| 色老头综合免费视频| 1000部拍拍拍18勿入免费凤凰福利 | 亚洲av中文无码| 亚洲人和日本人jizz| 青青操视频在线免费观看| 亚洲av之男人的天堂网站| 美女被爆羞羞网站免费| 亚洲午夜福利精品无码| AAA日本高清在线播放免费观看| 午夜免费福利在线| 国产AV无码专区亚洲AVJULIA| 综合偷自拍亚洲乱中文字幕| 亚洲免费在线视频观看| 亚洲一线产品二线产品| 久久久久国产精品免费网站| 亚洲av成人一区二区三区在线观看| 亚洲国产高清视频在线观看| 久久国产精品免费网站| 亚洲老妈激情一区二区三区| 7x7x7x免费在线观看| 亚洲一区二区三区电影| 女人18毛片a级毛片免费视频| 久久精品国产亚洲AV麻豆网站| 国内一级一级毛片a免费| 中文字幕的电影免费网站| 亚洲天堂在线视频| 日本片免费观看一区二区| 黄色免费网站在线看| 亚洲精选在线观看|