HTML网页图片滚动代码
<!--下面是向上滚动代码-->
<div id=butong_net_top style=overflow:hidden;height:100;width:90;>
<div id=butong_net_top1>
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
</div>
<div
id=butong_net_top2></div>
</div>
<script>
var speed=30
butong_net_top2.innerHTML=butong_net_top1.innerHTML
//克隆butong_net_top1为butong_net_top2
function Marquee1(){
//当滚动至butong_net_top1与butong_net_top2交界时
if(butong_net_top2.offsetTop-butong_net_top.scrollTop<=0)&<60;&<60;
butong_net_top.scrollTop-=butong_net_top1.offsetHeight
//butong_net_top跳到最顶端
else{
butong_net_top.scrollTop++;
}
}
var MyMar1=setInterval(Marquee1,speed)//设置定时器
//鼠标移上时清除定时器达到滚动停止的目的
butong_net_top.onmouseover=function() {clearInterval(MyMar1)}
//鼠标移开时重设定时器
butong_net_top.onmouseout=function(){MyMar1=setInterval(Marquee1,speed)}
</script>
<!--向上滚动代码结束-->
<br>
<!--下面是向下滚动代码-->
<div id=butong_net_bottom
style=overflow:hidden;height:100;width:90;>
<div id=butong_net_bottom1>
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
<img src="插入需要滚动的图片">
</div>
<div
id=butong_net_bottom2></div>
</div>
<script>
var speed=30
butong_net_bottom2.innerHTML=butong_net_bottom1.innerHTML
butong_net_bottom.scrollTop=butong_net_bottom.scrollHeight
function Marquee2(){
if(butong_net_bottom1.offsetTop-butong_net_bottom.scrollTop>=0)
butong_net_bottom.scrollTop+=butong_net_bottom2.offsetHeight
else{
butong_net_bottom.scrollTop--
}
}
var MyMar2=setInterval(Marquee2,speed)
butong_net_bottom.onmouseover=function()
{clearInterval(MyMar2)}
butong_net_bottom.onmouseout=function()
{MyMar2=setInterval(Marquee2,speed)}
</script>
<!--向下滚动代码结束-->
<br>
<!--下面是向左滚动代码-->
<div id="butong_net_left"
style="overflow:hidden;width:500px;">
<table cellpadding="0" cellspacing="0"
border="0">
<tr><td
id="butong_net_left1" valign="top"
align="center">
<table cellpadding="2" cellspacing="0"
border="0">
<tr align="center">
<td><img
src="<img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
</tr>
</table>
</td>
<td id="butong_net_left2"
valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30//速度数值越大速度越慢
butong_net_left2.innerHTML=butong_net_left1.innerHTML
function Marquee3(){
if(butong_net_left2.offsetWidth-butong_net_left.scrollLeft<=0)
butong_net_left.scrollLeft-=butong_net_left1.offsetWidth
else{
butong_net_left.scrollLeft++
}
}
var MyMar3=setInterval(Marquee3,speed)
butong_net_left.onmouseover=function()
{clearInterval(MyMar3)}
butong_net_left.onmouseout=function()
{MyMar3=setInterval(Marquee3,speed)}
</script>
<!--向左滚动代码结束-->
<br>
<!--下面是向右滚动代码-->
<div id="butong_net_right"
style="overflow:hidden;width:500px;">
<table cellpadding="0" cellspacing="0"
border="0">
<tr><td
id="butong_net_right1" valign="top"
align="center">
<table cellpadding="2" cellspacing="0"
border="0">
<tr align="center">
<td><img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
<td><img
src="插入需要滚动的图片"></td>
</tr>
</table>
</td>
<td id="butong_net_right2"
valign="top"></td>
</tr>
</table>
</div>
<script>
var speed=30//速度数值越大速度越慢
butong_net_right2.innerHTML=butong_net_right1.innerHTML
function Marquee4(){
if(butong_net_right.scrollLeft<=0)
butong_net_right.scrollLeft+=butong_net_right2.offsetWidth
else{
butong_net_right.scrollLeft--
}
}
var MyMar4=setInterval(Marquee4,speed)
butong_net_right.onmouseover=function()
{clearInterval(MyMar4)}
butong_net_right.onmouseout=function()
{MyMar4=setInterval(Marquee4,speed)}
</script>
<!--向右滚动代码结束-->
HTML网页图片滚动代码的更多相关文章
- html 图片滚动代码
我自己也在用的,网页常用!分享出来 最简单易懂源码 <!--下面是向上滚动代码--> <div id=butong_net_top style=overflow:hidden;hei ...
- JS图片滚动代码(无缝、平滑)
非常平滑的JS图片滚动特效代码,无缝循环,速度可自定义,鼠标悬停时停止.它的特点是JS和图片地址分离,这样做你就经易的从数据库动态调用每张图片的地址,方便控制,因此它非常的应用. <!DOCTY ...
- java爬虫-简单爬取网页图片
刚刚接触到“爬虫”这个词的时候是在大一,那时候什么都不明白,但知道了百度.谷歌他们的搜索引擎就是个爬虫. 现在大二.再次燃起对爬虫的热爱,查阅资料,知道常用java.python语言编程,这次我选择了 ...
- python:将网页图片保存到本地
1.requests库介绍 在python中,有一个非常好用的网络请求库requests,使用它可以发起网络请求,并获取网页返回的内容.同时,也可以进行网页图片下载 requests是使用Apache ...
- 14种网页图片和文字特效的jQuery插件代码
1.网页图片3d旋转jQuery代码 演示和下载地址 2.存css3实现的tabl选项卡代码 演示和下载地址 3.jQuery标签旋转代码 演示和下载地址 4.鼠标悬浮的图片选项卡代码 演示和下载地址 ...
- 图片滚动(UP)的JS代码详解(offsetTop、scrollTop、offsetHeigh)【转】
源地址 信息技术教材配套的光盘里有一段设置图片滚动的JS代码,与网络上差不多,实现思路:一个设定高度并且隐藏超出它高度的内容的容器demo,里面放demo1和 demo2,demo1是滚动内容,dem ...
- jquery图片无缝滚动代码左右 上下无缝滚动图片
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 原生js实现tab选项卡里内嵌图片滚动特效代码
<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8&quo ...
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
innerHTML: 设置或获取位于对象起始和结束标签内的 HTML scrollHeight: 获取对象的滚动高度. scrollLeft: 设置或获取位于对象左边界和窗口中目前可见内容的 ...
随机推荐
- EF-CodeFirst-表关系-延迟/贪婪加载
表关系建立: http://blog.csdn.net/niewq/article/details/17232321 一对多: namespace LckLib.EF.V6.Models { publ ...
- 2013 ACM区域赛长沙 C Collision HDU 4793
题意:在平面上0,0点,有一个半径为R的圆形区域,并且在0,0点固定着一个半径为RM(<R)的圆形障碍物,现在圆形区域外x,y,有一个半径 为r的,并且速度为vx,vy的硬币,如果硬币碰到了障碍 ...
- Java-String之寻根问底
Java-String之寻根问底 引言 在java编程中,几乎每天都会跟String打交道,因此,深入理解String及其用法十分有必要.下面分三方面来详细说明下String相关的特点及用法 •Imm ...
- Code Forces Gym 100886J Sockets(二分)
J - Sockets Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Valera ...
- Android MediaPlayer Error/Info Code
1. 常见错误 error(-38, 0) 我觉得-38表示在当前的MediaPlayer状态下,不能运行你的操作. 详细怎样做请參考:Android MediaPlayer 另外我在其它资料中.发现 ...
- Chapter 3 - How to Move a sprite
http://www.eoeandroid.com/forum.php?mod=viewthread&tid=250529 http://www.cocos2d-x.org/boards/6/ ...
- 自己封装的工具类,使用原生SwipeRefreshLayout+RecycleView实现下拉刷新和加载更多
实现SwipeRefreshLayout+RecycleView实现刷新 在你的xml文件里写上如下代码: <android.support.v4.widget.SwipeRefreshLayo ...
- CentOS6.5编译安装最新MySQL 5.7.11
安装前工作:1,从官方网址下载MySQL5.7.11源码包,大概49M2,安装好CentOS6.5 64位操作系统.建议update操作系统,以便是此版本最新的3. yum -y install g ...
- php 白屏
访问php白屏(base on lnmp) vim nginx/conf/fastcgi_param fastcgi_param REDIRECT_STATUS 200; fastcgi_param ...
- CentOS 6.7编译安装PHP7
1.首先配置好编译环境 yum update && yum upgrade yum groupinstall "Development Tools" yum ins ...