在线演示: DEMO

DEMO中及以下代码并没有写兼容代码,请使用高级浏览器打开,IE版本对CSS3支持并不太友好,IE11打开没有滚屏效果。

兼容代码前缀:

-webkit-

-moz-

-o-

-ms-

直接上代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>pagaToggle</title>
<style> /* Pre Style */ * { padding: 0; margin: 0; border: none; outline: none; text-decoration: none; }
body { overflow: hidden; } /* fontface */ @font-face {
font-family: "raphaelicons";
src: url('fonts/raphaelicons-webfont.eot') ,
url('fonts/raphaelicons-webfont.svg') ,
url('fonts/raphaelicons-webfont.ttf') ,
url('fonts/raphaelicons-webfont.woff') ;
font-weight: normal;
font-style: normal;
} /* media */ @media screen and ( max-width: 500px ) {
.box .pages > section > div { width: 40vw; height: 40vw; }
.box .pages > section > h2 { font-size: 15vw; top: 5vw; }
} @media screen and ( max-width: 1100px ) {
.box .pages > section > figure > figcaption > a > span { font-size: 5vw; line-height: 200px; }
} /* Nav Style */ .box { width: 100%; height: 100%; }
.box > input, .box > a, .box > a:after { position: fixed; }
.box > input { width: 20%; height: 60px; opacity: 0; z-index: 2; cursor: pointer; bottom: 0; }
.box > a { width: 20%; height: 60px; display: inline-block; text-align: center; color: white; font: 2vw/60px arial; text-shadow: 1px 1px 1px black; background-color: #f14d6f; z-index: 1; bottom: 0; }
.box > a:after { content: ""; width: 0; height: 0; display: block; border: 40px solid rgba(0,0,0,0); border-bottom-color: #f14d6f; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); } .box > input:nth-of-type(1),a:nth-of-type(1){ left: 0%; }
.box > input:nth-of-type(2),a:nth-of-type(2){ left: 20%; }
.box > input:nth-of-type(3),a:nth-of-type(3){ left: 40%; }
.box > input:nth-of-type(4),a:nth-of-type(4){ left: 60%; }
.box > input:nth-of-type(5),a:nth-of-type(5){ left: 80%; }
.box > input:checked + a { background-color: #8c1e34; }
.box > input:checked + a:after { border-bottom-color: #8c1e34; }
.box > input:hover + a { background-color: #c13955; }
.box > input:hover + a:after { border-bottom-color: #c13955; }
.box > input:checked:hover + a { background-color: #8c1e34; }
.box > input:checked:hover + a:after { border-bottom-color: #8c1e34; } /* Toggle Style */ .box > input:nth-of-type(1):checked ~ .pages { transform: translateY(0vh); }
.box > input:nth-of-type(2):checked ~ .pages { transform: translateY(-100vh); }
.box > input:nth-of-type(3):checked ~ .pages { transform: translateY(-200vh); }
.box > input:nth-of-type(4):checked ~ .pages { transform: translateY(-300vh); }
.box > input:nth-of-type(5):checked ~ .pages { transform: translateY(-400vh); }
.box > input:nth-of-type(1):checked ~ .pages > section:nth-of-type(1) > figure > img { animation: imgfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(2):checked ~ .pages > section:nth-of-type(2) > figure > img { animation: imgfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(3):checked ~ .pages > section:nth-of-type(3) > figure > img { animation: imgfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(4):checked ~ .pages > section:nth-of-type(4) > figure > img { animation: imgfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(5):checked ~ .pages > section:nth-of-type(5) > figure > img { animation: imgfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(1):checked ~ .pages > section:nth-of-type(1) > figure > figcaption > a > span { animation: textfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(2):checked ~ .pages > section:nth-of-type(2) > figure > figcaption > a > span { animation: textfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(3):checked ~ .pages > section:nth-of-type(3) > figure > figcaption > a > span { animation: textfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(4):checked ~ .pages > section:nth-of-type(4) > figure > figcaption > a > span { animation: textfloat .6s ease-in backwards .4s; }
.box > input:nth-of-type(5):checked ~ .pages > section:nth-of-type(5) > figure > figcaption > a > span { animation: textfloat .6s ease-in backwards .4s; } @keyframes imgfloat {
from { opacity: 0; transform: translateY(-40px); }
to { opacity: 1; }
} @keyframes textfloat {
from { opacity: 0; transform: translateY(40px); }
to { opacity: 1; }
} /* Pages Style */ .pages { transition: all .6s linear; }
.pages > section { width: 100vw; height: 100vh; background-color: white; text-align: center; color: #ffa2b5; overflow: hidden; position: relative; }
.pages > section:nth-of-type(odd) { background-color: #ffa2b5; color: white; }
.pages > section > div { width: 300px; height: 300px; background: #ffa2b5; margin: 0 auto; text-align: center; transform: translateY(-50%) rotate(45deg); }
.pages > section:nth-of-type(odd) div { background: white; }
.pages > section > h2 { font-family: "raphaelicons"; font-size: 120px; color: white; display: inline-block; position: absolute; top: 4vh; left: 50%; transform: translateX(-50%); }
.pages > section:nth-of-type(odd) > h2 { color: #ffa2b5; }
.pages > section > figure > img { box-shadow: 0 0 3px black; opacity: 1; }
.pages > section > figure > figcaption > a > span { font: 80px/270px arial; text-shadow: 1px 1px 1px black; color: #ffa2b5; }
.pages > section:nth-of-type(odd) > figure > figcaption > a > span { color: white; } </style>
</head>
<body>
<div class="box">
<input type="radio" name="page_btn" checked>
<a href="javascript:;">Page1</a>
<input type="radio" name="page_btn">
<a href="javascript:;">Page2</a>
<input type="radio" name="page_btn">
<a href="javascript:;">Page3</a>
<input type="radio" name="page_btn">
<a href="javascript:;">Page4</a>
<input type="radio" name="page_btn">
<a href="javascript:;">Page5</a>
<div class="pages">
<section>
<div></div>
<h2>g</h2>
<figure>
<img src="img/1.png" alt="pic">
<figcaption>
<a href="http://www.cnblogs.com/glunefish" target="_blank"><span>THIS IS GLUNEFISH BLOG.</span></a>
</figcaption>
</figure>
</section>
<section>
<div></div>
<h2>d</h2>
<figure>
<img src="img/1.png" alt="pic">
<figcaption>
<a href="http://www.cnblogs.com/glunefish" target="_blank"><span>THIS IS GLUNEFISH BLOG.</span></a>
</figcaption>
</figure>
</section>
<section>
<div></div>
<h2>e</h2>
<figure>
<img src="img/1.png" alt="pic">
<figcaption>
<a href="http://www.cnblogs.com/glunefish" target="_blank"><span>THIS IS GLUNEFISH BLOG.</span></a>
</figcaption>
</figure>
</section>
<section>
<div></div>
<h2>f</h2>
<figure>
<img src="img/1.png" alt="pic">
<figcaption>
<a href="http://www.cnblogs.com/glunefish" target="_blank"><span>THIS IS GLUNEFISH BLOG.</span></a>
</figcaption>
</figure>
</section>
<section>
<div></div>
<h2>h</h2>
<figure>
<img src="img/1.png" alt="pic">
<figcaption>
<a href="http://www.cnblogs.com/glunefish" target="_blank"><span>THIS IS GLUNEFISH BLOG.</span></a>
</figcaption>
</figure>
</section>
</div>
</div>
</body>
</html>

【CSS3】使用CSS3制作全屏切换效果的更多相关文章

  1. Html 全屏切换效果

    来源 http://www.imooc.com/learn/374 pageswitch.js (function ($) { var defaults = { 'container': '#cont ...

  2. jquery简单的大背景banner图片全屏切换

    详细内容请点击 这个是我初毕业刚进公司那会帮同事(同时也是同学)写的一个PC端的全屏图片切换效果,对于刚毕业的我来说写出来那会的喜悦之情是无法言表的,那时的我还是什么不懂的小白白,俗称菜鸟.个人网站上 ...

  3. jQuery插件开发——全屏切换插件

    这个插件包含三个部分:HTML结构.CSS代码和JS代码. HTML结构是固定的,结构如下: <!--全屏滚动--> <div class="fullpage-contai ...

  4. 全屏滚动效果H5FullscreenPage.js

    前提: 介于现在很多活动都使用了 类似全屏滚动效果 尤其在微信里面 我自己开发了一个快速构建 此类项目的控件 与市面上大部分控件不同的是此控件还支持元素的动画效果 并提供多种元素效果 基于zepto. ...

  5. pagePiling.js - 创建漂亮的全屏滚动效果

    全屏滚动效果是最近非常流行的网页设计形式,带给用户良好的视觉和交互体验.pagePiling.js 这款 jQuery 插件可以帮助前端开发人员轻松实现这种效果.支持所有的主流浏览器,包括IE8+,支 ...

  6. 原生JS实现全屏切换以及导航栏滑动隐藏及显示——重构前

    思路分析: 向后滚动鼠标滚轮,页面向下全屏切换:向前滚动滚轮,页面向上全屏切换.切换过程为动画效果. 第一屏时,导航栏固定在页面顶部,切换到第二屏时,导航条向左滑动隐藏.切换回第一屏时,导航栏向右滑动 ...

  7. jQuery鼠标滚动垂直全屏切换代码

    体验效果:http://hovertree.com/texiao/jquery/68/ 源码下载:http://hovertree.com/h/bjaf/f643upc4.htm 代码如下: < ...

  8. js实现网页全屏切换(平滑过渡),鼠标滚动切换

    实现效果为页面平滑过渡全屏切换,点击导航和鼠标滚动都可以切换. 效果图: html代码: <!DOCTYPE html> <html> <head lang=" ...

  9. HTML5实现网页的全屏切换

    使用HTML5提供的JavaScript Api可以实现主流浏览器的全屏和退出全屏操作,封装成进入全屏和退出全屏的函数如下: //进入全屏 function enterFullScreen() { v ...

随机推荐

  1. PCL配置即常见问题

    1    下载 把与VS版本对应PCL的AllInOne包下载下来.要下对安装包,需要了解安装包的命名的含义,以下面的一个AllInOne包的名字为例. PCL-1.8.0-AllInOne-msvc ...

  2. UWP获取任意网页加载完成后的HTML

    主要思想:通过后台WebView载入指定网页,再提取出WebView中的内容 关键代码: var html = await webView.InvokeScriptAsync("eval&q ...

  3. qt获取本机ip

    //获取本机IP QString getIP(QString localHost) { QString ipAddr; #if 0 QList<QHostAddress> AddressL ...

  4. C++:参数

    一.基础 实参是形参的初始值,对每个形参都需要穿一个能转换为它的实参 形参列表中的形参通常用逗号隔开,其中每个形参都含有一个声明符的声明 二.main(int argc, char *argv[]) ...

  5. 使用Velero Restic快速完成云原生应用迁移至ACK集群

    本文记录使用Velero Restic快速完成云原生应用迁移至ACK集群的实践过程. 0. 实践步骤概览 (1)创建GKE集群(或自建Kubernetes集群)(2)在GKE集群上部署示例应用Jenk ...

  6. Docker Remote API使用准备

    1 修改配置文件 CentOS: /etc/sysconfig/docker Ubuntu: /etc/init/docker.conf 1.添加: DOCKER_OPTS='-H tcp://0.0 ...

  7. Servlet FilterConfig

    FilterConfig的对象由Web容器创建.这个对象可用于获取web.xml文件中Filter的配置信息 文件:index.html <!DOCTYPE html> <html& ...

  8. mysql 使用concat模糊查询

    如果这三个字段中有值为NULL,则返回的也是NULL,那么这一条记录可能就会被错过,使用IFNULL进行判断 SELECT * FROM `magazine` WHERE CONCAT(IFNULL( ...

  9. windows10环境运用SSH和SwitchySharp自由翱翔

    以下纯干货: 安装篇: 安装git bash(自行去找下载包) 安装xshell(开始想用它,后来直接在git bash里用命令搞定了,安装它SSH Server就可用了可能) 安装Chrome的插件 ...

  10. Flask 第二篇

    Flask 中的 Render Redirect HttpResponse 1.Flask中的HTTPResponse 在Flask 中的HttpResponse 在我们看来其实就是直接返回字符串 2 ...