html5图片切换 jquery.tiles图片切换插件按钮控制图片百叶窗切换效果



105 418 140



特效描述: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

加群请备注:从官网了解到