jQuery页面滚动监听事件及高级效果插件

1. One Page scroll (只适用于上下焦点图)
http://www.thepetedesign.com/demos/onepage_scroll_demo.html

2. Scrolld(更不好用)
https://github.com/charliegeiger89/Scrolld.js#readme

3. Animate Scroll(参数太少,不好用)
https://github.com/ramswaroop/animatescroll.js#readme

归纳地址:
http://udn.yyuap.com/thread-68533-1-1.html

onepage-scroll

demo.html

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>onpage-scroll</title>
<link rel="stylesheet" href="onepage-scroll.css">
<link rel="stylesheet" href="demo.css">
<script src="jquery-3.1.1.min.js"></script>
<script src="jquery.onepage-scroll.min.js"></script>
</head>
<body> <div class="wrapper">
<div class="main onepage-wrapper">
<section class="section page1">
<img src="phones.png" alt="phones">
</section>
<section class="section page2">
<img src="back-phone.png" alt="back-phone">
</section>
<section class="section page3">
<img src="tilted-phone.png" alt="tiled-phone">
</section>
</div>
</div> <script>
$(function () {
$('.main section.page1 > img ').delay(300).animate({
'right': '0'
}, 300);
}); $('.main').onepage_scroll({
sectionContainer: "section",
easing: "ease",
animationTime: 300,
pagination:true,
updateURL: false,
beforeMove: function (index) {
switch (index) {
case 1:
$('.main section.page1 > img ').css({
'right': '-300px'
});
break;
case 2:
$('.main section.page2 > img ').css({
'left': '-150px'
});
break;
case 3:
$('.main section.page3 > img ').css({
'left': '-150px'
});
default:
break;
}
},
afterMove: function (index) {
switch (index) {
case 1:
$('.main section.page1 > img ').animate({
'right': '0'
}, 300);
break;
case 2:
$('.main section.page2 > img ').animate({
'left': '0'
}, 300);
break;
case 3:
$('.main section.page3 > img ').animate({
'left': '0'
}, 300);
break;
default:
break;
}
},
loop: false,
keyboard: true,
responsiveFallback: false,
direction: "vertical"
});
</script> </body>
</html>

demo.css

html {
height: 100%;
} body {
background: #e2e4e7;
padding:;
text-align: center;
font-family: 'open sans';
position: relative;
margin:;
height: 100%;
-webkit-font-smoothing: antialiased;
} .wrapper {
height: 100% !important;
margin: 0 auto;
overflow: hidden;
} .main {
width: 100%;
float: left;
margin: 0 auto;
} .onepage-wrapper {
width: 100%;
height: 100%;
display: block;
} .onepage-wrapper .section {
width: 100%;
height: 100%;
} .main section.page1 {
background: rgb(230, 217, 200);
} .main section.page2 {
background: #555557 no-repeat center;
}
.main section.page3 {
background: no-repeat;
} .main section.page1 > img {
position: absolute;
right: -300px;
} .main section.page2 > img {
position: absolute;
left: -150px;
} .main section.page3 > img {
position: absolute;
left: 156px;
}

项目地址:

https://github.com/liuqiuchen/onepage-scroll

jQuery页面滚动监听事件及高级效果插件的更多相关文章

  1. js和jquery实现页面滚动监听

    js和jquery实现页面滚动监听 一.总结 一句话总结:onscroll方法和监听页面元素的高度都可以实现滚动监听. 1.onscroll方法实现滚动监听的核心代码是什么? <body ons ...

  2. jQuery的滚动监听

    jQuery的滚动监听 1.当前滚动的地方的窗口顶端到整个页面顶端的距离: var winPos = $(window).scrollTop(); 2.获取指定元素的页面位置: $(val).offs ...

  3. 避免jquery多次监听事件

    jQuery.event.dispatch 事件分发监听源码简单理解是将绑定的事件放入队列后进行监听,如果对一个事件多次绑定(on或者bind),事件会重复添加到队列等待jq监听,这样会导致很大资源消 ...

  4. jquery四种监听事件的区别

    最近找工作被问到了jquery有哪些事件监听,都有什么区别,忽然有点想不起来了... 然后上网上查看了相关的资料,总结一下,方便大家查看,也方便自己复习! 1.bind()方法: bind(type, ...

  5. jQuery实现滚动监听

    1.设计思路 1)获取窗口滚动高度: 2)获取附加导航栏: 3)获取导航栏下的所有li: 4)通过相同class获取所有监听元素:(此例中为jumbotron巨幕) 5)遍历所有监听元素,若当前元素距 ...

  6. jQuery实现导航监听事件

    导航html如下 <div class="main_nav"> <a class="nav_01 active_01" href=" ...

  7. html页面监听事件

    今天有个需求,类似以下: <div id="a"> <input name="yinzhangfenlei" id="yinzhan ...

  8. 第二百四十四节,Bootstrap下拉菜单和滚动监听插件

    Bootstrap下拉菜单和滚动监听插件 学习要点: 1.下拉菜单 2.滚动监听 本节课我们主要学习一下 Bootstrap 中的下拉菜单插件,这个插件在以组件的形式我们 已经学习过,那么现在来看看怎 ...

  9. amaze ui 滚动监听

    引入   此框架的css  js    前提还要有jquery http://amazeui.org/javascript/scrollspy 然后看这个链接里的各种动画 运用方法就是  在你想要有动 ...

随机推荐

  1. libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)

    log报错如下: Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated w ...

  2. C# random生成随机数全部一样

    最近做排序测试  使用random生成随机数全部一样 估计是因为random采用的随机种子为时间戳 而一个循化执行消耗的时间没有到时间戳的最小单位 故没有变化 Thread.Sleep(10); 使用 ...

  3. 浅析Linux下进程间通信:共享内存

    浅析Linux下进程间通信:共享内存 共享内存允许两个或多个进程共享一给定的存储区.因为数据不需要在客户进程和服务器进程之间复制,所以它是最快的一种IPC.使用共享内存要注意的是,多个进程之间对一给定 ...

  4. Android消息机制:Looper,MessageQueue,Message与handler

    Android消息机制好多人都讲过,但是自己去翻源码的时候才能明白. 今天试着讲一下,因为目标是讲清楚整体逻辑,所以不追究细节. Message是消息机制的核心,所以从Message讲起. 1.Mes ...

  5. TransactionScope 事务使用说明

    TransactionScope是.Net Framework 2.0滞后,新增了一个名称空间.它的用途是为数据库访问提供了一个“轻量级”[区别于:SqlTransaction]的事物.使用之前必须添 ...

  6. EasyUI DataGrid 配置参数

    var queryParams = $('#SBDiv_1_DateGrid').datagrid('options').queryParams; queryParams.SearchTime = & ...

  7. 数据模型类对比 反射c#

    using System;using System.ComponentModel.DataAnnotations; public class LoginModel    {               ...

  8. PHP疑惑

    <?php $a = array(); $a[0] = 1; $a[1] = 2; $b = (object)$a; var_dump($b); 怎么从对象$b 中取值??? <?php ...

  9. poj3468 A Simple Problem with Integers (线段树区间最大值)

    A Simple Problem with Integers Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 92127   ...

  10. 河南省第八届ACM程序设计大赛

    A:挑战密室 #include <iostream> #include <cstdio> #include <cstring> #include <algor ...