web移动端滑动插件
1、slip只有6.3k可以说是非常小了,主要是通过css3里面的transform来改变的位置,控制的是父容器,使用也非常简单,具体信息移步slip.js。一个简单的demo如下
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<title>slip</title>
<style>
*{padding: ;margin: ;}
/*框架*/
.swipe-wrap{width: %;height: %;position: relative;overflow: hidden;}
.swipe{position:absolute;width:%;}
.swipe-box{width: %;overflow: hidden;}
</style> </head> <body> <div class="swipe-wrap" id="slip">
<article class="swipe"> <div class="swipe-box" style="background-color: gray;">
第1屏
</div> <div class="swipe-box" style="background-color: green;">
第2屏
</div> <div class="swipe-box" style="background-color: orange;">
第3屏
</div> <div class="swipe-box" style="background-color: blue;">
第4屏
</div> </article>
</div> </body> <script type="text/javascript" src="js/slip.js"></script>
<script type="text/javascript">
var container = document.getElementById('slip');
var pages = document.querySelectorAll('.swipe-box');
var slip = Slip(container, 'y').webapp(pages);
</script> </html>
2、fullpage也只有7k,它是通过显示隐藏来实现的,而且支持缩放等效果,网上还有一个大的fullpage,功能更全主要在pc端使用的比较多,不要搞混了,下面介绍这个是不依赖JQ的,那个大的是依赖JQ的,具体信息移步fullpage
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<title>fullPage</title>
<style>
*{padding: 0;margin: 0;} body{overflow: hidden;}
.page-wrap{overflow:hidden}
.page{display:none;width:100%;height:100%;overflow:hidden;position:absolute;top:0;left:0}
.contain{width:100%;height:100%;display:none;position:relative;z-index:0}
.current .contain,.slide .contain{display:block}
.current{display:block;z-index:1}
.slide{display:block;z-index:2}
.swipe{display:block;z-index:3;transition-duration:0ms!important;-webkit-transition-duration:0ms!important}
</style>
</head>
<body>
<div id="pageContain" class="page-wrap"> <div class="page page1 current" style="background-color: green;">
<div class="contain">
第一屏
</div>
</div> <div class="page page2" style="background-color: yellow;">
<div class="contain">
第二屏
</div>
</div> <div class="page page3" style="background-color: gray;">
<div class="contain">
第三屏
</div>
</div> <div class="page page4" style="background-color: purple;">
<div class="contain">
第四屏
</div>
</div>
</div> </body> <script type="text/javascript" src="js/fullPage.js"></script>
<script type="text/javascript">
//禁止窗口的默认滑动
document.ontouchmove = function(e){
e.preventDefault();
} runPage = new FullPage({ id : 'pageContain',
slideTime : 800,
continuous : true,
effect : {
transform : {
translate : 'Y',
scale : [0.5, 1],
rotate : [0, 0]
},
opacity : [0, 1]
},
mode : 'wheel,touch',
easing : 'ease',
}); </script>
</html>
web移动端滑动插件的更多相关文章
- 从零开始学 Web 之 移动Web(五)touch事件的缺陷,移动端常用插件
大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... github:https://github.com/Daotin/Web 微信公众号:Web前端之巅 博客园:ht ...
- 移动端触摸滑动插件Swiper
移动端触摸滑动插件Swiper 04/02/2015 一.了解Swiper 目前移动端项目一般都需要具有触屏焦点图的效果,如果你也需要实现这一功能的话,Swiper是一个不错的选择. 1.他不需要加载 ...
- swiper嵌套小demo(移动端触摸滑动插件)
swiper(移动端触摸滑动插件) tip:自己敲得Swiper 的小demo,可以复制粘贴看看效果哦. swiper的js包css包下链接地址 : https://github.com/Clear ...
- 移动端触摸滑动插件Swiper使用指南
Swiper是一款开源.免费.功能十分强大的移动端内容触摸滑动插件,目前的最新版本是Swiper4.Swiper主要面向的是手机.平板电脑等移动设备,帮助开发者轻松实现触屏焦点图.触屏Tab切换.触屏 ...
- 【miscellaneous】海康威视监控摄像头实现web端无插件监控实拍效果
[rtsp]海康威视监控摄像头实现web端无插件监控实拍效果 详细介绍参见:http://live.cuplayer.com/RtspCameraLive.html web端无须装插件(支持PC,安卓 ...
- 自制 移动端 纯原生 Slider滑动插件
在Google搜关键字“slider”或“swiper”能找到一大堆相关插件,自己造轮子是为了能更好的理解其中的原理. 给这个插件取名为“veSlider”是指“very easy slider”非常 ...
- Swipe-移动端触摸滑动插件swipe.js
原文链接:http://caibaojian.com/swipe.html 插件特色 viaswipe.JS是一个比较有名的触摸滑动插件,它能够处理内容滑动,支持自定义选项,你可以让它自动滚动,控制滚 ...
- 【转载】Web移动端Fixed布局的解决方案
特别声明:本文转载于EFE的<Web移动端Fixed布局的解决方案>.如需转载,烦请注明原文出处:http://efe.baidu.com/blog/mobile-fixed-layout ...
- photoSlider-原生js移动开发轮播图、相册滑动插件
详细内容请点击 在线预览 立即下载 使用方法: 分别引用css文件和js文件 如: <link rel="stylesheet" type="text/css& ...
随机推荐
- Spring源码-加载和IOC部分
源代码和注释放在了github上,包括加载过程的注释和getBean部分的 地址: https://github.com/lvxingzhi/spring-framework-4.3.9-note.g ...
- hdu 1280 前m大的数(排序)
题意:排序 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namespa ...
- Apktool 和 Jeb 给出的不同的smali语法
今天发现用Apktool和Jeb反编译出来的smali在语法上有一定区别,比如一个Java函数: private void packageNameCheck() { com.example.testf ...
- bzoj1012最大数maxnumber——单调栈
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1012 单调栈水题:用了一下lower_bound二分. 代码如下: #include< ...
- mfc画波形函数
void CMyPicoTestDlg::DrawWave(CDC *pDC,CRect &rectPicture) { float fDeltaX; float fDeltaY; int n ...
- Spring中JdbcTemplate的基础用法
Spring中JdbcTemplate的基础用法 1.在DAO中使用JdbcTemplate 一般都是在DAO类中使用JdbcTimplate,在XML配置文件中配置好后,可以在DAO中注入即可. 在 ...
- 关于checkbox对应一张表时如何遍历
html代码: <table> <tr> <td><input name='one' type='checkbox' value='1'/></t ...
- linux之打包压缩命令
tar:主选项:[一条命令以下5个参数只能有一个]-c: --create 新建一个压缩文档,即打包-x: --extract,--get解压文件-t: --list,查看压缩文档里的文件目录-r:- ...
- jquery 点击某一行,得到这一行的每个列的数据
<html><head> <title>test</title> <script src="../Scripts/jquery-1.8. ...
- STL-开篇
基本概念 STL: Standard Template Library,标准模板库 定义: c++引入的一个标准类库 特点:1)数据结构和算法的 c++实现( 采用模板类和模板函数)2)数据的存储和算 ...