html5 svg全屏圖片切換遮罩動畫特效



98 391 131



特效描述:html5 svg 全屏圖片切換 遮罩動畫特效,這是一款炫酷的html5和SVG遮罩圖片切換特效。該特效使用SVG剪裁和遮罩技術,通過snap.svg插件制作圖片切換過渡特效,支持移動手機,支持鍵盤控制和滑動控制。

代碼結構

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/demo.css">
<link rel="stylesheet" href="css/libs/bootstrap.min.css">
<link rel="stylesheet" href="css/slider.css">
<link rel="stylesheet" href="css/main.css">

2. 引入JS

<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="js/libs/jquery.mobile.custom.min.js" type="text/javascript"></script>
<script src="js/libs/snap.svg-min.js" type="text/javascript"></script>
<script src="js/libs/bootstrap.min.js" type="text/javascript"></script>
<script src='js/TweenMax.min.js' type="text/javascript"></script>
<script src="js/slider.js" type="text/javascript"></script>

3. HTML代碼

	<div class="portfolio slider-wrapper">
	    <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">
	        <li class="visible">
	            <div class="svg-wrapper">
	                <svg viewBox="0 0 1400 800">
	                    <defs>
	                        <clipPath id="image-1">
	                            <path id="changing-path-1" d="M1400,800H0V0h1399c0.6,0,1,0.4,1,1V800z"/>
	                        </clipPath>							
	                    </defs>						
	                    <image height='100%' width="100%" clip-path="url(#image-1)" href="img/2.jpg"></image>
	                    <div class="slider__info">
	                        <p class="slider__title text">
	                            <span class="text__first">
	                                <span class="text__word">Karbokam</span>
	                                <span class="text__first-bg" style="background-color: #3A7E94"></span>
	                            </span>
	                        </p>
	                        <p class="slider__desc text">
	                            <span class="text__second">
	                                <span class="text__word">Production of technical carboxymethyl cellulose <br> (CMC) and polyanionic cellulose (PAC)</span>
	                                <span class="text__second-bg" style="background-color: #E688A1"></span>
	                            </span>
	                        </p>
	                    </div>
	                    <div class="slider__link cd-slider-navigation">
	                        <a href="#0" class="next-slide slider__site text">
	                            <span class="text__first">
	                                <span class="text__word">Visit karbokam.ru <img class="arrow" src="img/arrow.svg" alt=""></span>
	                                <span class="text__first-bg" style="background-color: #3A7E94"></span>
	                            </span>
	                        </a>
	                        <p class="slider__visit text">
	                            <span class="text__second">
	                                <span class="text__word">Official website</span>
	                                <span class="text__second-bg" style="background-color: #E688A1"></span>
	                            </span>
	                        </p>
	                    </div>
	                </svg>
	            </div> <!-- .svg-wrapper -->
	        </li>
	        <li>
	            <div class="svg-wrapper">
	                <svg viewBox="0 0 1400 800">
	                    <defs>
	                        <clipPath id="image-2">
	                            <path id="changing-path-2" d="M1400,800H0V0h1399c0.6,0,1,0.4,1,1V800z"/>
	                        </clipPath>
	                    </defs>
	                    <image height='100%' width="100%" clip-path="url(#image-2)" href="img/1.jpg"></image>	
	                    <div class="slider__info">
	                        <p class="slider__title text">
	                            <span class="text__first">
	                                <span class="text__word">UAZ KD</span>
	                                <span class="text__first-bg" style="background-color: #535986"></span>
	                            </span>
	                        </p>
	                        <p class="slider__desc text">
	                            <span class="text__second">
	                                <span class="text__word">Authorized distributor of UAZ (Ulyanovsk Automobile <br> Plant)</span>
	                                <span class="text__second-bg" style="background-color: #DABDB2"></span>
	                            </span>
	                        </p>
	                    </div>
	                    <div class="slider__link cd-slider-navigation">
	                        <a href="#0" class="next-slide slider__site text">
	                            <span class="text__first">
	                                <span class="text__word">Visit uaz159.ru<img class="arrow" src="img/arrow.svg" alt=""></span>
	                                <span class="text__first-bg" style="background-color: #535986"></span>
	                            </span>
	                        </a>
	                        <p class="slider__visit text">
	                            <span class="text__second">
	                                <span class="text__word">Official website</span>
	                                <span class="text__second-bg" style="background-color: #DABDB2"></span>
	                            </span>
	                        </p>
	                    </div>				
	                </svg>
	            </div> <!-- .svg-wrapper -->
	        </li>
	        <li>
	            <div class="svg-wrapper">
	                <svg viewBox="0 0 1400 800">
	                    <defs>
	                        <clipPath id="image-3">
	                            <path id="changing-path-3" d="M1400,800H0V0h1399c0.6,0,1,0.4,1,1V800z"/>
	                        </clipPath>
	                    </defs>
	                    <image height='100%' width="100%" clip-path="url(#image-3)" href="img/3.jpg"></image>	
	                    <div class="slider__info">
	                        <p class="slider__title text">
	                            <span class="text__first">
	                                <span class="text__word">Karbokam</span>
	                                <span class="text__first-bg" style="background-color: #1ABDFE"></span>
	                            </span>
	                        </p>
	                        <p class="slider__desc text">
	                            <span class="text__second">
	                                <span class="text__word">Production of technical carboxymethyl cellulose <br> (CMC) and polyanionic cellulose (PAC)</span>
	                                <span class="text__second-bg" style="background-color: #CB1537"></span>
	                            </span>
	                        </p>
	                    </div>
	                    <div class="slider__link cd-slider-navigation">
	                        <a href="#0" class="next-slide slider__site text">
	                            <span class="text__first">
	                                <span class="text__word">Visit karbokam.ru <img class="arrow" src="img/arrow.svg" alt=""></span>
	                                <span class="text__first-bg" style="background-color: #1ABDFE"></span>
	                            </span>
	                        </a>
	                        <p class="slider__visit text">
	                            <span class="text__second">
	                                <span class="text__word">Official website</span>
	                                <span class="text__second-bg" style="background-color: #CB1537"></span>
	                            </span>
	                        </p>
	                    </div>			
	                </svg>
	            </div> <!-- .svg-wrapper -->
	        </li>
	    </ul> <!-- .slider -->
	    <ol class="slider-controls">
	          <li class="selected"><a href="#0"><em>Item 1</em></a></li>
	        <li><a href="#0"><em>Item 2</em></a></li>
	        <li><a href="#0"><em>Item 2</em></a></li>
	      <!-- other list items here -->
	   </ol> <!-- .slider-controls -->
	</div>



用戶評論
大牛,別默默的看了,快登錄幫我點評一下吧!:)      登錄 | 注冊


熱門標簽: flash焦點圖 flash幻燈片 flashbanner flash圖片輪播 加載動畫 滑動選項卡 滑動切換 滾動切換 滾動條切換 滑動手風琴 選項卡切換 選項卡 切換 tab切換 頁面切換 選項卡插件 切換插件 全屏焦點圖 h5彈窗動畫 html5彈窗動畫 全屏切換 寬屏全屏 寬屏 全屏 頁面全屏 頁面寬屏 h5動畫 h5背景動畫 h5場景動畫 h53D動畫 h5界面動畫 html5動畫 焦點圖 幻燈片 輪播圖 bar焦點圖 h5按鈕動畫 html5按鈕動畫 圖片全屏 h5圖片動畫 h5圖標動畫 html5圖片動畫 html5圖標動畫 圖片切換 圖片選項卡 圖標選項卡 背景切換 大圖切換 全屏焦點圖 選項卡自動切換
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

jQuery/js討論群
群號:642649996
Css3+Html5討論群
群號:322131262

加群請備注:從官網了解到

老夫子电子