html5圖片切換 jquery.tiles圖片切換插件按鈕控制圖片百葉窗切換效果



109 434 145



特效描述:html5圖片切換 jquery.tiles 圖片切換插件 按鈕控制 圖片百葉窗切換,jquery帶播放按鈕幻燈片,好幾種畫面特效。

代碼結構

1. 引入CSS

<link rel="stylesheet" href="css/normalize.css"/>
<link rel="stylesheet" href="css/styles.css" media="screen"/>
<link rel="stylesheet" href="css/jquery.tiles.min.css"/>

2. 引入JS

<script src="js/html5.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.tiles.js"></script>

3. HTML代碼

	<div class="title">
		<label>Effect:</label>
		<select id="effects-select">
			<option value="default">default</option>
			<option value="simple">simple</option>
			<option value="left">left</option>
			<option value="up">up</option>
			<option value="leftright">leftright</option>
			<option value="updown">updown</option>
			<option value="switchlr">switchlr</option>
			<option value="switchud">switchud</option>
			<option value="fliplr">fliplr</option>
			<option value="flipud">flipud</option>
			<option value="reduce">reduce</option>
			<option value="360">360</option>
		</select>
		<div class="code">
			<code>x: 6</code>
			<code>y: 4</code>
			<code>random: true</code>
		</div>
		<button type="button" class="start action">Play</button>
		<button type="button" class="stop action">Stop</button>
	</div>
	<div class="slider-wrap">
		<div class="slider">
			<p><strong>Pig ham:</strong> hock pork loin brisket pastrami frankfurter andouille.</p>
			<img src="img/img01.jpg"/><p><strong>Sausage:</strong> ground round sirloin ball tip beef ribs.</p>
			<img src="img/img02.jpg"/><p><strong>Pig ham:</strong> hock pork loin brisket pastrami frankfurter andouille.</p>
			<img src="img/img03.jpg"/><p><strong>Pork turkey:</strong> shoulder, filet mignon chuck t-bone bacon.</p>
			<img src="img/img04.jpg"/><p><strong>Short loin:</strong> pig jowl fatback, pork loin pork chop.</p>
			<img src="img/img05.jpg"/><p><strong>Sausage:</strong> ground round sirloin ball tip beef ribs.</p>
			<img src="img/img06.jpg"/><p><strong>Pig ham:</strong> hock pork loin brisket pastrami frankfurter andouille.</p>
			<img src="img/img07.jpg"/><p><strong>Pork turkey:</strong> shoulder, filet mignon chuck t-bone bacon.</p>
			<img src="img/img08.jpg"/><p><strong>Short loin:</strong> pig jowl fatback, pork loin pork chop.</p>
			<img src="img/img09.jpg"/><p><strong>Sausage:</strong> ground round sirloin ball tip beef ribs.</p>
			<img src="img/img10.jpg"/><p><strong>Pig ham:</strong> hock pork loin brisket pastrami frankfurter andouille.</p>
		</div>
	</div>
	<script type="text/javascript">
	var $slider = $('.slider-wrap');
	var html = $slider.html();
	// Options
	var defaults = {
		thumbSize:20,
		onSlideshowEnd:function(){
			$('.stop, .start').toggle()
		}
	};
	var effects = {
		'default': { x:6, y:4, random: true },
		simple: { x:6, y:4, effect: 'simple', random: true },
		left: { x:1, y:8, effect: 'left' },
		up: { x:20, y:1, effect: 'up', rewind: 60, backReverse: true },
		leftright: { x:1, y:8, effect: 'leftright' },
		updown: { x:20, y:1, effect: 'updown', cssSpeed: 500, backReverse: true },
		switchlr: { x:20, y:1, effect: 'switchlr', backReverse: true },
		switchud: { x:1, y:8, effect: 'switchud' },
		fliplr: { x:20, y:1, effect: 'fliplr', backReverse: true },
		flipud: { x:20, y:3, effect: 'flipud', reverse: true, rewind: 75 },
		reduce: { x:6, y:4, effect: 'reduce' },
		360: { x:1, y:1, effect: '360', fade: true, cssSpeed: 600 }
	};
	$('#effects-select').change(function(){
		var effect = $(this).val();
		$slider.fadeTo( 0,0 ).html( html );
		$('.stop').hide();
		$('.start').show();
		setTimeout(function(){
			$('.slider').tilesSlider($.extend( {}, defaults, effects[ effect ]));
			$slider.fadeTo( 0,1 );
			$('body').removeClass('tiles-preload');
		}, 100 );
		$('.code').empty().html(function() {
			var e = effects[ effect ], c = [];
			for ( var i in e ) {
				if ( i !== 'effect' ) {
					c.push('<code>'+ i +': '+ e[i] +'</code>');
				}
			}
			return c.join('');
		});
	});
	$('.start').click(function() {
		$(this).hide();
		$('.stop').show();
		$('.slider').tilesSlider('start');
	});
	$('.stop').click(function() {
		$(this).hide();
		$('.start').show();
		$('.slider').tilesSlider('stop');
	});
	$('.slider').tilesSlider( $.extend( {}, defaults, effects['default'] ) );
	</script>



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


熱門標簽: 滾動切換 滾動條切換 滑動選項卡 滑動切換 flash焦點圖 flash幻燈片 flashbanner flash圖片輪播 選項卡切換 選項卡 切換 tab切換 頁面切換 選項卡插件 切換插件 滑動手風琴 切換按鈕 表單 表單美化 表單插件 表單美化插件 焦點圖 幻燈片 輪播圖 bar焦點圖 帶標題的焦點圖 帶縮略圖的幻燈片 圖片切換 圖片選項卡 圖標選項卡 純圖片輪播 圖片輪播 選項卡自動切換 按鈕控制
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

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

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

老夫子电子