幻灯片/轮播

炫酷jQuery+SVG遮罩轮播图特效

阿里云


这是一款效果非常炫酷的 jQuery 和 SVG 遮罩轮播图特效。该轮播图特效使用 SVG 剪裁和遮罩技术,通过 snap.svg 插件制作轮播图图片过渡特效,支持移动手机,支持键盘控制和滑动控制。

使用方法

在页面中引入下面的 js 和 CSS 文件。

也想出现在这里?联系我们
创客主机
  1. <!-- CSS -->
  2. <link rel="stylesheet" href="/path/to/bootstrap.min.css">
  3. <link rel="stylesheet" href="css/slider.css">
  4. <link rel="stylesheet" href="css/main.css">
  5.  
  6. <!-- JavaScipt -->
  7. <script src="/path/to/jquery-min.js"></script>
  8. <script src="/path/to/jquery.mobile.custom.min.js"></script>
  9. <script src="/path/to/snap.svg-min.js"></script>
  10. <script src="/path/to/bootstrap.min.js"></script>
  11. <script src="/path/to/TweenMax.min.js"></script>
  12. <script src="js/slider.js"></script>

HTML 结构

该 jQuery 和 SVG 遮罩轮播图特效的 HTML 结构如下。

  1. <div class="portfolio slider-wrapper">
  2.   <ul class="slider" data-step1="M1402,800h-2V0h1c0.6,0,1,0.4,1,1V800z" data-step2="M1400,800H379L771.2,0H1399c0.6,0,1,0.4,1,1V800z" data-step3="M1400,800H0V0h1399c0.6,0,1,0.4,1,1V800z" data-step4="M-2,800h2V0h-1c-0.6,0-1,0.4-1,1V800z" data-step5="M0,800h1021L628.8,0L1,0C0.4,0,0,0.4,0,1L0,800z" data-step6="M0,800h1400V0L1,0C0.4,0,0,0.4,0,1L0,800z">
  3.  
  4.       <li class="visible">
  5.           <div class="svg-wrapper">
  6.               <svg viewBox="0 0 1400 800">
  7.                   <defs>
  8.                       <clipPath id="image-1">
  9.                           <path id="changing-path-1" d="M1400,800H0V0h1399c0.6,0,1,0.4,1,1V800z"/>
  10.                       </clipPath>             
  11.                   </defs>           
  12.                   <image height='100%' width="100%" clip-path="url(#image-1)" href="img/2.jpg"></image>
  13.                   <div class="slider__info">
  14.                       <p class="slider__title text">
  15.                           <span class="text__first">
  16.                               <span class="text__word">Karbokam</span>
  17.                               <span class="text__first-bg" style="background-color: #3A7E94"></span>
  18.                           </span>
  19.                       </p>
  20.                       <p class="slider__desc text">
  21.                           <span class="text__second">
  22.                               <span class="text__word">Production of technical carboxymethyl cellulose <br> (CMC) and polyanionic cellulose (PAC)</span>
  23.                               <span class="text__second-bg" style="background-color: #E688A1"></span>
  24.                           </span>
  25.                       </p>
  26.                   </div>
  27.                   <div class="slider__link cd-slider-navigation">
  28.                       <a href="#0" class="next-slide slider__site text">
  29.                           <span class="text__first">
  30.                               <span class="text__word">Visit karbokam.ru <img class="arrow" src="img/arrow.svg" alt=""></span>
  31.                               <span class="text__first-bg" style="background-color: #3A7E94"></span>
  32.                           </span>
  33.                       </a>
  34.                       <p class="slider__visit text">
  35.                           <span class="text__second">
  36.                               <span class="text__word">Official website</span>
  37.                               <span class="text__second-bg" style="background-color: #E688A1"></span>
  38.                           </span>
  39.                       </p>
  40.                   </div>
  41.               </svg>
  42.           </div> <!-- .svg-wrapper -->
  43.       </li>
  44.  
  45.       <li>
  46.           <div class="svg-wrapper">
  47.               <svg viewBox="0 0 1400 800">
  48.                   <defs>
  49.                       <clipPath id="image-2">
  50.                           <path id="changing-path-2" d="M1400,800H0V0h1399c0.6,0,1,0.4,1,1V800z"/>
  51.                       </clipPath>
  52.                   </defs>
  53.                   <image height='100%' width="100%" clip-path="url(#image-2)" href="img/1.jpg"></image> 
  54.  
  55.                   <div class="slider__info">
  56.                       <p class="slider__title text">
  57.                           <span class="text__first">
  58.                               <span class="text__word">UAZ KD</span>
  59.                               <span class="text__first-bg" style="background-color: #535986"></span>
  60.                           </span>
  61.                       </p>
  62.                       <p class="slider__desc text">
  63.                           <span class="text__second">
  64.                               <span class="text__word">Authorized distributor of UAZ (Ulyanovsk Automobile <br> Plant)</span>
  65.                               <span class="text__second-bg" style="background-color: #DABDB2"></span>
  66.                           </span>
  67.                       </p>
  68.  
  69.                   </div>
  70.                   <div class="slider__link cd-slider-navigation">
  71.                       <a href="#0" class="next-slide slider__site text">
  72.                           <span class="text__first">
  73.                               <span class="text__word">Visit uaz159.ru<img class="arrow" src="img/arrow.svg" alt=""></span>
  74.                               <span class="text__first-bg" style="background-color: #535986"></span>
  75.                           </span>
  76.                       </a>
  77.                       <p class="slider__visit text">
  78.                           <span class="text__second">
  79.                               <span class="text__word">Official website</span>
  80.                               <span class="text__second-bg" style="background-color: #DABDB2"></span>
  81.                           </span>
  82.                       </p>
  83.                   </div>        
  84.               </svg>
  85.  
  86.           </div> <!-- .svg-wrapper -->
  87.       </li>
  88.  
  89.       <li>
  90.           <div class="svg-wrapper">
  91.               <svg viewBox="0 0 1400 800">
  92.                   <defs>
  93.                       <clipPath id="image-3">
  94.                           <path id="changing-path-3" d="M1400,800H0V0h1399c0.6,0,1,0.4,1,1V800z"/>
  95.                       </clipPath>
  96.                   </defs>
  97.                   <image height='100%' width="100%" clip-path="url(#image-3)" href="img/3.jpg"></image> 
  98.  
  99.                   <div class="slider__info">
  100.                       <p class="slider__title text">
  101.                           <span class="text__first">
  102.                               <span class="text__word">Karbokam</span>
  103.                               <span class="text__first-bg" style="background-color: #1ABDFE"></span>
  104.                           </span>
  105.                       </p>
  106.                       <p class="slider__desc text">
  107.                           <span class="text__second">
  108.                               <span class="text__word">Production of technical carboxymethyl cellulose <br> (CMC) and polyanionic cellulose (PAC)</span>
  109.                               <span class="text__second-bg" style="background-color: #CB1537"></span>
  110.                           </span>
  111.                       </p>
  112.                   </div>
  113.                   <div class="slider__link cd-slider-navigation">
  114.                       <a href="#0" class="next-slide slider__site text">
  115.                           <span class="text__first">
  116.                               <span class="text__word">Visit karbokam.ru <img class="arrow" src="img/arrow.svg" alt=""></span>
  117.                               <span class="text__first-bg" style="background-color: #1ABDFE"></span>
  118.                           </span>
  119.                       </a>
  120.                       <p class="slider__visit text">
  121.                           <span class="text__second">
  122.                               <span class="text__word">Official website</span>
  123.                               <span class="text__second-bg" style="background-color: #CB1537"></span>
  124.                           </span>
  125.                       </p>
  126.                   </div>      
  127.               </svg>
  128.  
  129.           </div> <!-- .svg-wrapper -->
  130.       </li>
  131.  
  132.   </ul> <!-- .slider -->
  133.  
  134.   <ol class="slider-controls">
  135.         <li class="selected"><a href="#0"><em>Item 1</em></a></li>
  136.       <li><a href="#0"><em>Item 2</em></a></li>
  137.       <li><a href="#0"><em>Item 2</em></a></li>
  138.     <!-- other list items here -->
  139.   </ol> <!-- .slider-controls -->
  140. </div>

Github 地址:https://github.com/alikinvv/svg-mask-slider

炫酷 jQuery+SVG 遮罩轮播图特效

已有 539 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!