//侧栏随动
var rollStart = $('.feed-mail'), //滚动到此区块的时候开始随动
rollSet = $('.search,.weibo,.group,.feed-mail,.tags'); //添加rollStart之前的随动区块 rollStart.before('<div class="da_rollbox" style="position:fixed;background-color:#fff;width:inherit;"></div>');
var offset = rollStart.offset(),objWindow = $(window),rollBox = rollStart.prev();
objWindow.scroll(function() {
if (objWindow.scrollTop() > offset.top){
if(rollBox.html(null)){
rollSet.clone().prependTo('.da_rollbox');
}
rollBox.show().stop().animate({top:0,paddingTop:15},400);
} else {
rollBox.hide().stop().animate({top:0},400);
}
});

jQuery 随滚动条滚动效果 (固定版)的更多相关文章

  1. jQuery 随滚动条滚动效果 (适用于内容页长文章)

    直接入题! 当内容页比较长的时候,网站右侧一直是空白,不如放点有用的东西给用户看,最好不要放广告,因为那样很邪恶,你懂的. 好吧,昨天写了这个东西,jQuery滚动随动区块,代码如下: //侧栏随动 ...

  2. jquery控制div随滚动条滚动效果

    <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jquery div随滚动条 ...

  3. jquery 禁止滚动条滚动,并且滚动条不消失,页面大小不闪动

    一,禁止滚动,滚动条不消失,页面大小不闪动 //禁止滚动条滚动 function unScroll() { var top = $(document).scrollTop(); $(document) ...

  4. jQuery仿百度帖吧头部固定不随滚动条滚动效果

    <style> *{margin:0px;padding:0px;} div.nav{background:#000000;height:57px;line-height:57px;col ...

  5. 使用 jQuery.Pin 垂直滚动时固定导航

    ZKEACMS的导航默认是不能固定的,随着页面的滚动而滚动,为了有更好的用户体验,当页面往下滚动时,可以将导航固定在顶端,这样方便用户点击. jQuery Pin 借助jQuery的一个插件 jQue ...

  6. jquery操作滚动条滚动到指定元素位置 scrollTop

    $('.brand_t a').bind('click',function(){ if($(this).attr('title1')){ var toChar = $(this).attr('titl ...

  7. Jquery 文字上下滚动效果示例代码

      <!doctype html>   <html>   <head>   <meta charset="utf-8">       ...

  8. JQuery控制滚动条滚动到指定位置

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  9. jquery操作滚动条滚动到指定位置

    <html><head><script type="text/javascript" src="/jquery/jquery.js" ...

随机推荐

  1. URI--http://zh.wikipedia.org/wiki/%E7%BB%9F%E4%B8%80%E8%B5%84%E6%BA%90%E6%A0%87%E5%BF%97%E7%AC%A6

    维基百科,自由的百科全书     在电脑术语中,统一资源标识符(Uniform Resource Identifier,或URI)是一个用于标识某一互联网资源名称的字符串. 该种标识允许用户对网络中( ...

  2. Xcode中插件的安装以及Xcode升级后插件实效的解决方法

    插件的安装 下载好插件,直接运行,然后将Xcode关闭,再次打开Xcode会弹出一个提醒框. 这时候选择 Load Bundle 即可,这时候插件就安装到了Xcode上. Xcode所有的插件都安装在 ...

  3. hdu2317Nasty Hacks

    Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of mali ...

  4. Simple Daemon Shell

    PROPATH="/var/www/html/" PROGRAM="vertical" LOGNAME="/tmp/monitor.vertical. ...

  5. isNUll ,对于sql中的一个表的description的NULL和空格的处理

    select client.clientname ,description,'client2'= case when client.Description IS NULL then  client.c ...

  6. canvas认识

    1使用canvas绘制一个矩形 <canvas id="canvas" width="640" height="360">< ...

  7. LinearLayout遇到的问题——利用LinearLayout做横向滑动冲突

    问题:当我添加两个TextView的时候,然后滑动,发现只生成了一个TextView. 就是 <?xml version="1.0" encoding="utf-8 ...

  8. 重读LPTHW-Lesson25

    1.ex25接触了字符串函数split().列表函数sorted().pop()函数,整理一下其用法以及其他常见的字符串.列表操作函数如下. (1)split()函数 split()是拆分字符串函数, ...

  9. Storm Esper

    https://github.com/hellojinjie https://github.com/tomdz/storm-esper https://github.com/jayway/awaiti ...

  10. C语言的本质(29)——C语言与汇编之寄存器和寻址方式

    x86的通用寄存器有eax.ebx.ecx.edx.edi.esi.这些寄存器在大多数指令中是可以任意选用的,比如movl指令可以把一个立即数传送到eax中,也可传送到ebx中.但也有一些指令规定只能 ...