js 右侧漂浮滚动
来源:互联网 发布:unity3d 切换摄像机 编辑:程序博客网 时间:2024/05/17 00:07
(function() {
function a() {
var a = d.scrollTop(),
b = f.innerHeight();
var rightWidth = (window.document.body.offsetWidth - 960) / 2;
if (window.document.body.offsetWidth < 960 || (/(iPad|iPhone|iTouch|iPod|IEMobile|Android)/i.test(navigator.userAgent))) {
return
}
g.removeAttr('style'), b > i && (i > j ? a + j > h + i ? a + j > h + b ? g.height() < 560 ? g.css({
position: 'fixed',
top: '0px',
right: rightWidth + 'px'
}) : g.css({
position: 'absolute',
bottom: '0px',
right: '0px'
}) : a > i - 460 ? g.css({
position: 'fixed',
top: '0px',
right: rightWidth + 'px'
}) : g.css({
position: 'fixed',
bottom: '0px',
right: rightWidth + 'px'
}) : g.css({
position: 'static'
}) : a > h ? a + i > h + b ? g.css({
position: 'absolute',
bottom: '10px'
}) : g.css({
position: 'fixed',
top: '0px'
}) : g.css({
position: 'static'
}))
}
var b = navigator.userAgent;
if (!(b.indexOf('MSIE 6') > 0)) {
var c = $(window),
d = $(document),
e = $('.main'),
f = e.find('.cont'),
g = e.find('.sideRight'),
h = f.offset().top,
i = g.height() + 460,
j = c.height();
e.css('position', 'relative'), c.on({
scroll: a,
resize: function() {
j = c.height(), a()
}
}), a()
}
}());
function a() {
var a = d.scrollTop(),
b = f.innerHeight();
var rightWidth = (window.document.body.offsetWidth - 960) / 2;
if (window.document.body.offsetWidth < 960 || (/(iPad|iPhone|iTouch|iPod|IEMobile|Android)/i.test(navigator.userAgent))) {
return
}
g.removeAttr('style'), b > i && (i > j ? a + j > h + i ? a + j > h + b ? g.height() < 560 ? g.css({
position: 'fixed',
top: '0px',
right: rightWidth + 'px'
}) : g.css({
position: 'absolute',
bottom: '0px',
right: '0px'
}) : a > i - 460 ? g.css({
position: 'fixed',
top: '0px',
right: rightWidth + 'px'
}) : g.css({
position: 'fixed',
bottom: '0px',
right: rightWidth + 'px'
}) : g.css({
position: 'static'
}) : a > h ? a + i > h + b ? g.css({
position: 'absolute',
bottom: '10px'
}) : g.css({
position: 'fixed',
top: '0px'
}) : g.css({
position: 'static'
}))
}
var b = navigator.userAgent;
if (!(b.indexOf('MSIE 6') > 0)) {
var c = $(window),
d = $(document),
e = $('.main'),
f = e.find('.cont'),
g = e.find('.sideRight'),
h = f.offset().top,
i = g.height() + 460,
j = c.height();
e.css('position', 'relative'), c.on({
scroll: a,
resize: function() {
j = c.height(), a()
}
}), a()
}
}());
0 0
- js 右侧漂浮滚动
- 网页右侧的漂浮广告代码,随滚动条滚动
- 网页右侧的漂浮广告代码,随滚动条滚动
- 跟随滚动条漂浮的JS特效
- 右侧公告漂浮
- 右侧漂浮代码
- js 右侧浮动层(跟随滚动)
- js 悬浮漂浮 及jquery的滚动事件
- JS漂浮广告代码
- 对联漂浮js
- js漂浮广告代码
- js广告漂浮类
- 网页漂浮的js
- JS 随机漂浮物
- 漂浮广告js代码
- js漂浮广告
- js图片漂浮效果
- JS漂浮广告代码
- Autodesk 2016版系列产品的新功能和新开发接口提前透露. 开发者大会DevDays 下个月开始.
- Pascal's Triangle
- IOS常用宏定义
- 初识javascript
- android EditText相关的知识点汇总
- js 右侧漂浮滚动
- 解决AfxLoadLibrary错误号为126的问题
- PullToRefresh使用详解(一)--构建下拉刷新的listView
- asp.net linq 字符串排序问题
- 伪随机数生成器
- [leetcode]Reverse Integer(%、/、int与String转换)
- 最大的悉尼华人网站www.52xini.com
- 不可错过的前端开发资源大荟萃
- ASP.NET MVC3 实现多文件上传