javascript 向上滚动
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="zh-CN">
<meta name="Keywords" content=",,">
<meta name="Description" content=" /">
<title>SuperSlide - 文字无缝滚动特效-上</title>
<!-- <script src="http://libs.baidu.com/jquery/1.4.2/jquery.min.js"></script> --> </head> <body> <style type="text/css"> /* css 重置 */
*{margin:; padding:; list-style:none; }
body{ background:#fff; font:normal 12px/22px 宋体; }
img{ border:; }
a{ text-decoration:none; color:#; }
a:hover{ color:#1974A1; } /* 本例子css */
.txtMarquee-top{ overflow:hidden; position:relative; border:1px solid #ccc; }
.txtMarquee-top .hd{ overflow:hidden; height:30px; background:#f4f4f4; padding: 10px; }
.txtMarquee-top .hd .prev,.txtMarquee-top .hd .next{ display:block; width:9px; height:5px; float:right; margin-right:5px; margin-top:10px; overflow:hidden;
cursor:pointer; background:url("../images/arrow.png") -100px no-repeat;}
.txtMarquee-top .hd .next{ background-position: -140px; }
.txtMarquee-top .hd .prevStop{ background-position:-60px -100px; }
.txtMarquee-top .hd .nextStop{ background-position:-60px -140px; }
.txtMarquee-top .bd{ padding:15px; }
.txtMarquee-top .infoList li{ height:24px; line-height:24px; }
.txtMarquee-top .infoList li .date{ float:right; color:#; } </style> <div class="txtMarquee-top">
<div class="bd">
<div class="tempWrap" id="tempWrap" style="overflow:hidden; position:relative; height:120px" >
<ul class="infoList" id="infoList" style="position: relative; padding: 0px; margin: 0px; top: 0px;" >
<li class="clone" style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">那些无法理解的荒唐事</a></li>
<li style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">中国打破了世界软件巨头规则</a></li>
<li style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">口语:会说中文就能说英语!</a></li>
<li style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">农场摘菜不如在线学外语好玩</a></li>
<li style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">数理化老师竟也看学习资料?</a></li>
<li style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">学英语送ipad2,45天突破听说</a></li>
<li style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">学外语,上北外!</a></li>
<li style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">那些无法理解的荒唐事</a></li>
<li class="clone" style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">中国打破了世界软件巨头规则</a></li>
<li class="clone" style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">口语:会说中文就能说英语!</a></li>
<li class="clone" style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">农场摘菜不如在线学外语好玩</a></li>
<li class="clone" style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">数理化老师竟也看学习资料?</a></li>
<li class="clone" style="height: 24px;"><span class="date">--</span><a href="#" target="_blank">学英语送ipad2,45天突破听说</a></li>
</ul>
</div>
</div>
</div> <script type="text/javascript"> window.onload=function(){ var InfoList = document.getElementById('infoList');
var li = document.getElementsByTagName('li');
var TempWrap = document.getElementById('tempWrap');
var HTempWrap = TempWrap.offsetHeight;
var HInfoList = InfoList.offsetHeight;
var index = ;
var Hli = li[].offsetHeight;
var Lli = li.length;
InfoList.style.height = Hli*Lli;
var info = (HInfoList-HTempWrap)*-; Timeint = setInterval(setTime,) TempWrap.onmouseover = function(){
clearInterval(Timeint);
};
TempWrap.onmouseout = function(){
Timeint = setInterval(setTime,);
}
function setTime(){ index --;
if(index <= info){
index = -;
return false;
}else{
index = index+-;
InfoList.style.top = index+'px';
}
} } </script> </body>
</html>
效果图:

javascript 向上滚动的更多相关文章
- JavaScript判断鼠标滑轮是向下还是向上滚动
我们常用的就是鼠标,鼠标中键一般都用于滑动网页,但是网页中很多很炫的效果,使用鼠标滑轮操作更好. 当然对于手机就没有这个设备了,所以就不用考虑手机端的实现方法,手机端有触摸滑动事件. 使用JavaSc ...
- 文字列表无缝向上滚动JavaScript代码
<!DOCTYPE html> <html> <head> <meta charset=utf-> <title>文字列表无缝向上滚动Jav ...
- jquery插件之文字间歇自动向上滚动
该插件乃本博客作者所写,目的在于提升作者的js能力,也给一些js菜鸟在使用插件时提供一些便利,老鸟就悠然地飞过吧. 此插件旨在实现目前较为流行的文字间歇向上滚动特效,当鼠标移动到文字上时,向上滚动会停 ...
- jquery插件之文字无缝向上滚动
该插件乃本博客作者所写,目的在于提升作者的js能力,也给一些js菜鸟在使用插件时提供一些便利,老鸟就悠然地飞过吧. 此插件旨在实现目前较为流行的无缝向上滚动特效,当鼠标移动到文字上时,向上滚动会停止, ...
- jquery 文字向上滚动+CSS伪类before和after的应用
汇总常用技巧——CSS伪类before和after的应用 先上效果图,建议遵循有图有真相的原则,可以上图的地方,还望不要嫌麻烦,毕竟有图的话 可以让读者少花些时间! <!DOCTYPE html ...
- JS判断鼠标向上滚动还是向下滚动
js如何判断滚轮的上下滚动,我们应该都见到过这种效果,用鼠标滚轮实现某个表单内的数字向上滚动就增加,向下滚动就减少的操作,这种效果是通过js对鼠标滚轮的事件监听来实现的.今天简单的研究了一下如何使用j ...
- js无间隙向上滚动
一.优点:div可以load:缺点:滚动的时候有点娘,磨磨唧唧,不够干脆爽快 html <div id="my_msg" class="my-msg bg-whit ...
- 利用自定义动画 animate() 方法,实现某图书网站中“近 7 日畅销榜”中的图书无缝垂直向上滚动特效:当光标移入到图书上时,停止滚动,鼠标移开时,继续滚动
查看本章节 查看作业目录 需求说明: 利用自定义动画 animate() 方法,实现某图书网站中"近 7 日畅销榜"中的图书无缝垂直向上滚动特效:当光标移入到图书上时,停止滚动,鼠 ...
- 齐博x2向上滚动特效
要实现图中圈起来的向上滚动特效,大家可以参考下面的代码 <!--滚动开始--> <style type="text/css"> .auto-roll{ he ...
随机推荐
- 导出Excel文件,npoi方式和通过microsoft.visual basic.dll
一:例子截图: 二:NPOI截图 三:EmployeeListWindow.cs代码 using System; using System.Collections.Generic; using Sys ...
- VS2010中的自动化测试(5)——Web性能测试
原文地址:http://www.cnblogs.com/heqichang/archive/2011/11/20/2256478.html 类目见这里:http://www.cnblogs.com/h ...
- mysql 循环插入100w
use md5db; DROP PROCEDURE if exists myFunction; delimiter $$ CREATE PROCEDURE myFunction() BEGIN DEC ...
- Linux用户root忘记密码的解决(unbuntu16.04)
参考: http://www.linuxidc.com/Linux/2012-04/59069.htm http://www.68idc.cn/help/server/linux/2015060735 ...
- Monkey log分析说明
运行命令: adb shell monkey -p com.crazyhornets.MyHokageAndroidZSY -v -v -v 20 -- throttle 1000 Log: :Mon ...
- Java模块化概念解惑与现状总结
在过去几年,Java模块化一直是一个活跃的话题.从JSR 277(现已废止)到JSR 291,模块化看起来是Java进化过程中的必经一环.即便是基于JVM的未来语言,比如Scala,也考虑了模块化的问 ...
- padding与margin的差别
之前一直没有搞懂android:padding和android:layout_margin的差别,事实上概念非常easy,padding是站在父view的角度描写叙述问题,它规定它里面的内容必须与这个 ...
- [转] ubuntu 12.04 安装 nginx+php+mysql web服务器
Nginx 是一个轻量级,以占用系统资源少,运行效率而成为web服务器的后起之秀,国内现在很多大型网站都以使用nginx,包括腾讯.新浪等大型信息网站,还有淘宝网站使用的是nginx二次开发的web服 ...
- Java基础知识强化之IO流笔记18:FileOutputStream写入数据
1. 创建字节输出流对象,做了几件事情: (1)调用系统功能去创建文件(2)创建fos对象(3)把fos对象指向这个文件 2. 代码示例: package com.himi.fileoutputstr ...
- AC自动机学习笔记
AC自动机 ----多个模板的字符串匹配 字典树Trie加上失配边构成 插入操作:ac.insert(p[i],i);构造失配函数:ac.getFail();计算文本串T中每个模板串的匹配数:ac.f ...