Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 好男人免费社区视频www,妇女网站爱嘿嘿视频免费观看,日本一区二区三区在线视频

          整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          JQ實現簡單的滑動解鎖

          始狀態

          解鎖狀態

          直接上代碼:

          <!DOCTYPE html>

          <html lang="en">

          <head>

          <meta charset="UTF-8">

          <meta name="viewport" content="width=device-width, initial-scale=1.0">

          <meta http-equiv="X-UA-Compatible" content="ie=edge">

          <title>滑動解鎖</title>

          <script src="js/jquery-1.11.0.js"></script>

          <style>

          *{

          margin:0;

          padding: 0;

          box-sizing: border-box;

          -webkit-touch-callout: none;

          -webkit-user-select: none;

          -khtml-user-select: none;

          -moz-user-select: none;

          -ms-user-select: none;

          user-select: none;

          }

          .outer{

          position: relative;

          margin:20px auto;

          width: 200px;

          height: 30px;

          line-height: 28px;

          border:1px solid #ccc;

          background: #ccc9c9;

          }

          .outer span,.filter-box,.inner{

          position: absolute;

          top: 0;

          left: 0;

          }

          .outer span{

          display: block;

          padding:0 0 0 36px;

          width: 100%;

          height: 100%;

          color: #fff;

          text-align: center;

          }

          .filter-box{

          width: 0;

          height: 100%;

          background: green;

          z-index: 9;

          }

          .outer.act span{

          padding:0 36px 0 0;

          }

          .inner{

          width: 36px;

          height: 28px;

          text-align: center;

          background: #fff;

          cursor: pointer;

          font-family: "宋體";

          z-index: 10;

          font-weight: bold;

          color: #929292;

          }

          .outer.act .inner{

          color: green;

          }

          .outer.act span{

          z-index: 100;

          }

          </style>

          </head>

          <body>

          <div class="outer">

          <div class="filter-box"></div>

          <span>

          滑動解鎖

          </span>

          <div class="inner">>></div>

          </div>

          </body>

          <script>

          $(function(){

          $(".inner").mousedown(function(e){

          var el = $(".inner"),os = el.offset(),dx,$span=$(".outer>span"),$filter=$(".filter-box"),_differ=$(".outer").width()-el.width();

          $(document).mousemove(function(e){

          dx = e.pageX - os.left;

          if(dx<0){

          dx=0;

          }else if(dx>_differ){

          dx=_differ;

          }

          $filter.css('width',dx);

          el.css("left",dx);

          });

          $(document).mouseup(function(e){

          $(document).off('mousemove');

          $(document).off('mouseup');

          dx = e.pageX - os.left;

          if(dx<_differ){

          dx=0;

          $span.html("滑動解鎖");

          }else if(dx>=_differ){

          dx=_differ;

          $(".outer").addClass("act");

          $span.html("解鎖成功");

          el.html('√');

          }

          $filter.css('width',dx);

          el.css("left",dx);

          })

          })

          })

          </script>

          </html>

          效果圖:

          、遇問題:

          產品說:“最近需要弄個活動發到朋友圈中,我把設計圖發給你”

          產品說:“有6張設計圖,我要上下滑動翻頁,都要放在一個頁面中啊,還有里面圖片要能動!要炫酷!,在加一個背景音樂哦”

          我(吊炸天,炫酷的,真是折磨人):“好”

          產品:“加油!”

          經理:“+1”

          老板:“+1”

          二、解決思路:

          1.要炫酷,要花里胡哨,自己寫估計要耗電時間,算了,找插件吧

          2.滑動翻頁:為了保證用戶體驗,不會再去加載下一頁,自己放到一個頁面,所以每個頁面放到一個DIV中,通過滑動來顯示指定DIV

          2.動畫效果:自己使用CSS插件:animate

          三、偽代碼

          HTML

          <div class="swiper-container" id="swiper-container-v">
           <section class="poster_wrap load" id="load">
           <div class="p_loading">
           <div class="p_loading_logo"></div>
           <p class="p_loading_tip">加載頁</p>
           </div>
           </section>
           <div class="swiper-wrapper">
           <!-------------slide1----------------->
           <section class="swiper-slide swiper-slide1 swiper-slide-v">
           <div class="index-top ani" swiper-animate-effect="fadeInUp" swiper-animate-duration="1s" swiper-animate-delay="1s">
           <h1>這是第一頁</h1>
           </div>
           </section>
           <!-------------slide2----------------->
           <section class="swiper-slide swiper-slide2 swiper-slide-v">
           <h1 class="posit_tit"><i class="about_us_tit_ico"></i>這是第二頁</h1>
           <div class="swiper-container ani" id="swiper-container-h" swiper-animate-effect="rotateInUpLeft" swiper-animate-duration="0.5s" swiper-animate-delay="0s">
           <div class="swiper-wrapper">
           <div class="swiper-slide slide1">
           <div class="posit_details_head">
           <h3 class="posit_details_tit">第二頁中的第1頁</h3>
           </div>
           <div class="job_details">
           <span class="job_address">page1</span>
           </div>
           </div>
           <div class="swiper-slide slide2">
           <div class="posit_details_head">
           <h3 class="posit_details_tit">第二頁中的第2頁</h3>
           </div>
           <div class="job_details">
           <span class="job_address">page2</span>
           </div>
           </div>
           <div class="swiper-slide slide3">
           <div class="posit_details_head">
           <h3 class="posit_details_tit">第二頁中的第3頁</h3>
           </div>
           <div class="job_details">
           <span class="job_address">page3</span>
           </div>
           </div>
           </div>
           </div>
           </section>
           </div>
           <!--向上箭頭-->
           <div class="arrow-box">
           <img src="images/arrow.png" id="array">
           </div>
          </div>
          

          四、解析

          使用到的是swiper插件做滑動翻頁,一般做活動廣告宣傳發到朋友圈,簡單上手,有炫酷。

          五、地址

          [演示地址](http://47.105.36.188:3030/toutiao/Swiper上下滑動翻頁面帶背景音樂/index.html)

          [源代碼下載](https://github.com/harryluo163/toutiao/tree/master/Swiper上下滑動翻頁面帶背景音樂)

          介:Captcha是開源的滑動驗證碼框架,需要前后端集成,后端可支持Spring Mvc Spring boot項目等 ,前端可支持純Html , Vue , Uni-app,原生Android,原生IOS。可快速地集成到項目,后端底層需要依賴Redis進行存儲。

          成品效果:

          新建 spring boot 項目

          新建項目不做演示了

          spring boot 集成Captcha

          pom.xml文件引入

          <!-- https://mvnrepository.com/artifact/com.anji-plus/spring-boot-starter-captcha -->
          <dependency>
              <groupId>com.anji-plus</groupId>
              <artifactId>spring-boot-starter-captcha</artifactId>
              <version>1.3.0</version>
          </dependency>

          在resources目錄下引入資源文件如下圖

          資源文件下載地址:https://gitee.com/hdx98k/captcha/tree/master/service/springboot/src/main/resources/images


          application.yml配置

          aj:
            captcha:
              jigsaw: classpath:images/jigsaw
            # 自定義背景圖切換
              pic-click: classpath:images/pic-click
            # 存儲方式redis
              cache-type: redis
              type: default
            # 支持自定義水印
              water-mark: 黃大俠
              slip-offset: 5
              aes-status: true
              interference-options: 2
              font-style: 1
              font-size: 25
              history-data-clear-enable: false
              req-frequency-limit-enable: false
              req-get-lock-limit: 5
              req-get-lock-seconds: 360
              req-get-minute-limit: 30
              req-check-minute-limit: 60
              req-verify-minute-limit: 60

          實現redis存儲接口CaptchaCacheService,手動新建類

          import com.anji.captcha.service.CaptchaCacheService;
          import org.springframework.beans.factory.annotation.Autowired;
          import org.springframework.data.redis.core.RedisTemplate;
          
          import java.util.concurrent.TimeUnit;
          
          public class CaptchaCacheServiceRedisImpl implements CaptchaCacheService {
          
              @Override
              public String type() {
                  return "redis";
              }
          
              @Autowired
              private RedisTemplate redisTemplate;
          
              @Override
              public void set(String key, String value, long expiresInSeconds) {
                  redisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS);
              }
          
              @Override
              public boolean exists(String key) {
                  return redisTemplate.hasKey(key);
              }
          
              @Override
              public void delete(String key) {
                  redisTemplate.delete(key);
              }
          
              @Override
              public String get(String key) {
                  return (String) redisTemplate.opsForValue().get(key);
              }
          
          	@Override
          	public Long increment(String key, long val) {
          		return redisTemplate.opsForValue().increment(key,val);
          	}
          }

          需要在META-INF目錄下新建個services的文件夾,新建文件com.anji.captcha.service.CaptchaCacheService,名字需要是這個名字,配置該類的類路徑如下圖


          最后啟動即可

          前端集成Captcha

          前端項目演示純Html

          Html部分代碼

          <div id="captchaContent" ></div>

          JS部分代碼

          <script src="component/captcha/js/verify.js" ></script>
          // 初始化驗證碼
          var flagReady = true;
          $('#captchaContent').slideVerify({
            baseUrl:http.getConfig().server.serverUrl+"/user",
            containerId:'loginBtn',
            mode:'pop',
            //圖片的大小對象
            imgSize : {      
              width: '400px',
              height: '200px',
            },
            barSize:{
              width: '400px',
              height: '40px',
            },
            beforeCheck:function(){ 
              var username=$("#userName").val().trim()
              if(!username && !flagReady){
                toast.error({message:"請輸入用戶名"})
                return 
              }
              requestData.username=username;
              var password=$("#pwd").val().trim()
              if(!password && !flagReady){
                toast.error({message:"請輸入密碼"})
                return 
              }
              requestData.password=password;
              return (username && password) || flagReady;
            },
            ready : function() {  //加載完畢的回調
              flagReady=false;
            },
            success : function(params) { //成功的回調
              console.log(params,"params");
              params.username=requestData.username;
              params.password=requestData.password;
              login(params);
            }
          });

          具體步驟詳情官網API文檔:https://captcha.anji-plus.com/#/doc

          源碼地址:https://gitee.com/hdx98k/captcha/tree/master

          文章編寫不易,希望對你有用!!![機智]


          主站蜘蛛池模板: 国产成人AV区一区二区三| 91一区二区三区四区五区| 国产精品亚洲专区一区| 亚洲日韩精品一区二区三区无码 | 国产经典一区二区三区蜜芽| 精彩视频一区二区三区| 亚洲Av无码国产一区二区| 曰韩精品无码一区二区三区| 一区二区三区四区在线播放 | 麻豆aⅴ精品无码一区二区| 国产伦精品一区二区三区免费下载 | 中文字幕亚洲乱码熟女一区二区| 无码人妻一区二区三区在线水卜樱| 在线播放偷拍一区精品| 99久久精品日本一区二区免费| 射精专区一区二区朝鲜| 日本不卡一区二区视频a| 国产一区二区精品久久凹凸 | 日韩免费一区二区三区在线| ...91久久精品一区二区三区| 久久久综合亚洲色一区二区三区| 久久99精品免费一区二区| 精品一区二区三区免费视频| 一区二区三区午夜| 亲子乱AV视频一区二区| 久久久久人妻精品一区蜜桃| 无码av免费一区二区三区试看| 久久91精品国产一区二区| 亚洲日本一区二区| 美女视频一区三区网站在线观看| 在线精品亚洲一区二区| 亚洲熟妇AV一区二区三区浪潮| 精品一区二区视频在线观看| 精品午夜福利无人区乱码一区| 亚洲熟妇无码一区二区三区| 国产精品一区电影| 无人码一区二区三区视频| 久久无码人妻一区二区三区| 最新欧美精品一区二区三区 | 国产一区二区精品久久岳√| 亚洲国产成人精品久久久国产成人一区二区三区综 |