html5全屏幻灯片游戏角色页面动画切换特效



240 959 320



特效描述:html5 全屏幻灯片 页面动画切换 切换特效,html5页面动画切换,全屏幻灯片动画切换

代码结构

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" href="css/style.css">

2. 引入JS

<script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>

3. HTML代码

<div class="slider__warpper">
	  <div class="flex__container flex--pikachu flex--active" data-slide="1">
		<div class="flex__item flex__item--left">
		  <div class="flex__content">
			<p class="text--sub">sc.chinaz.com</p>
			<h1 class="text--big">Pikachu</h1>
			<p class="text--normal">文本描述部分</p>
		  </div>
		  <p class="text__background">Pikachu</p>
		</div>
		<div class="flex__item flex__item--right"></div>
		<img class="pokemon__img" src="img/pikachu.png" />
	  </div>
	  <div class="flex__container flex--piplup animate--start" data-slide="2">
		<div class="flex__item flex__item--left">
		  <div class="flex__content">
			<p class="text--sub">Pokemon Gen IV</p>
			<h1 class="text--big">Piplup</h1>
			<p class="text--normal">Piplup is the Water-type Starter Pokémon of the Sinnoh region. It was introduced in Generation IV. Piplup has a strong sense of self-esteem. It seldom accepts food that people give because of its pride.</p>
		  </div>
		  <p class="text__background">Piplup</p>
		</div>
		<div class="flex__item flex__item--right"></div>
		<img class="pokemon__img" src="img/pilup.png" />
	  </div>
	  <div class="flex__container flex--blaziken animate--start" data-slide="3">
		<div class="flex__item flex__item--left">
		  <div class="flex__content">
			<p class="text--sub">Pokemon Gen III</p>
			<h1 class="text--big">Blaziken</h1>
			<p class="text--normal">Blaziken is the Fire/Fighting-type Starter Pokémon of the Hoenn region, introduced in Generation III. Blaziken is a large, bipedal, humanoid bird-like Pokémon that resembles a rooster.</p>
		  </div>
		  <p class="text__background">Blaziken</p>
		</div>
		<div class="flex__item flex__item--right"></div>
		<img class="pokemon__img" src="img/blaziken.png" />
	  </div>
	  <div class="flex__container flex--dialga animate--start" data-slide="4">
		<div class="flex__item flex__item--left">
		  <div class="flex__content">
			<p class="text--sub">Pokemon Gen IV</p>
			<h1 class="text--big">Dialga</h1>
			<p class="text--normal">Dialga is a Steel/Dragon-type Legendary Pokémon. Dialga is a sauropod-like Pokémon. It is mainly blue with some gray, metallic portions, such as its chest plate, which has a diamond in the center. It also has various, light blue lines all over
			  its body.</p>
		  </div>
		  <p class="text__background">Dialga</p>
		</div>
		<div class="flex__item flex__item--right"></div>
		<img class="pokemon__img" src="img/dialga.png" />
	  </div>
	  <div class="flex__container flex--zekrom animate--start" data-slide="5">
		<div class="flex__item flex__item--left">
		  <div class="flex__content">
			<p class="text--sub">Pokemon Gen V</p>
			<h1 class="text--big">Zekrom</h1>
			<p class="text--normal">Zekrom is a Dragon/Electric-type Legendary Pokémon. It is part of the Tao Trio, along with Reshiram and Kyurem. Zekrom is a large, black draconian Pokémon that seems to share its theme with its counterpart, Reshiram. It has piercing red eyes and
			  dark gray to black skin that seems to be armor-like.</p>
		  </div>
		  <p class="text__background">Zekrom</p>
		</div>
		<div class="flex__item flex__item--right"></div>
		<img class="pokemon__img" src="img/zekrom.png" />
	  </div>
	</div>
	<div class="slider__navi">
	  <a href="#" class="slide-nav active" data-slide="1">pikachu</a>
	  <a href="#" class="slide-nav" data-slide="2">piplup</a>
	  <a href="#" class="slide-nav" data-slide="3">blaziken</a>
	  <a href="#" class="slide-nav" data-slide="4">dialga</a>
	  <a href="#" class="slide-nav" data-slide="5">zekrom</a>
	</div>
<script type="text/javascript">
	$('.slide-nav').on('click', function(e) {
	  e.preventDefault();
	  // get current slide
	  var current = $('.flex--active').data('slide'),
		// get button data-slide
		next = $(this).data('slide');
	  $('.slide-nav').removeClass('active');
	  $(this).addClass('active');
	  if (current === next) {
		return false;
	  } else {
		$('.slider__warpper').find('.flex__container[data-slide=' + next + ']').addClass('flex--preStart');
		$('.flex--active').addClass('animate--end');
		setTimeout(function() {
		  $('.flex--preStart').removeClass('animate--start flex--preStart').addClass('flex--active');
		  $('.animate--end').addClass('animate--start').removeClass('animate--end flex--active');
		}, 800);
	  }
	});
</script>



用户评论
大牛,别默默的看了,快登录帮我点评一下吧!:)      登录 | 注册


热门标签: 导航切换 图片全屏 带标题的焦点图 文字全屏 带缩略图的幻灯片 带简介的焦点图 图片切换 360全景 图片轮播 文字切换 自动滚动图片轮播 背景切换 马赛克幻灯片 手风琴 全屏焦点图 选项卡自动切换 视频切换 列表切换 渐隐切换 全屏切换 切换按钮 缩放切换 滚动切换 滑动选项卡切换 flash焦点图 选项卡切换 滑动手风琴 全屏焦点图 全屏切换 宽屏全屏满屏 焦点图幻灯片

×
×
51前端

注册

官方QQ群
qq群

扫描上面二维码加微信群

官方QQ群

jQuery/js讨论群
群号:642649996
Css3+Html5讨论群
群号:322131262

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