<!--下面是向上滚动代码-->

<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网页图片滚动代码的更多相关文章

  1. html 图片滚动代码

    我自己也在用的,网页常用!分享出来 最简单易懂源码 <!--下面是向上滚动代码--> <div id=butong_net_top style=overflow:hidden;hei ...

  2. JS图片滚动代码(无缝、平滑)

    非常平滑的JS图片滚动特效代码,无缝循环,速度可自定义,鼠标悬停时停止.它的特点是JS和图片地址分离,这样做你就经易的从数据库动态调用每张图片的地址,方便控制,因此它非常的应用. <!DOCTY ...

  3. java爬虫-简单爬取网页图片

    刚刚接触到“爬虫”这个词的时候是在大一,那时候什么都不明白,但知道了百度.谷歌他们的搜索引擎就是个爬虫. 现在大二.再次燃起对爬虫的热爱,查阅资料,知道常用java.python语言编程,这次我选择了 ...

  4. python:将网页图片保存到本地

    1.requests库介绍 在python中,有一个非常好用的网络请求库requests,使用它可以发起网络请求,并获取网页返回的内容.同时,也可以进行网页图片下载 requests是使用Apache ...

  5. 14种网页图片和文字特效的jQuery插件代码

    1.网页图片3d旋转jQuery代码 演示和下载地址 2.存css3实现的tabl选项卡代码 演示和下载地址 3.jQuery标签旋转代码 演示和下载地址 4.鼠标悬浮的图片选项卡代码 演示和下载地址 ...

  6. 图片滚动(UP)的JS代码详解(offsetTop、scrollTop、offsetHeigh)【转】

    源地址 信息技术教材配套的光盘里有一段设置图片滚动的JS代码,与网络上差不多,实现思路:一个设定高度并且隐藏超出它高度的内容的容器demo,里面放demo1和 demo2,demo1是滚动内容,dem ...

  7. jquery图片无缝滚动代码左右 上下无缝滚动图片

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  8. 原生js实现tab选项卡里内嵌图片滚动特效代码

    <!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8&quo ...

  9. 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全

    innerHTML:    设置或获取位于对象起始和结束标签内的 HTML scrollHeight: 获取对象的滚动高度. scrollLeft:   设置或获取位于对象左边界和窗口中目前可见内容的 ...

随机推荐

  1. HDU- 2265 Encoding The Diary

    Encoding The Diary Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  2. linux下用Apache一个IP多个网站多域名配置方法

    如有两个域名,分别是desk.xker.com和tool.xker.com,需把这两个域名都绑定到IP是219.13.34.32的服务器上 1.首先需在域名供应商管理页面指定域名和IP的对应关系 2. ...

  3. (转载)TRS内容管理平台用户注册逻辑漏洞

    首先 site:gov.cn inurl:WCM TRS 的内容管理系统是国内政府网站使用最多的系统之一 如上面所说:外交部 http://wcm.fmprc.gov.cn/wcm/ 网址加上:wcm ...

  4. SSL 通信及 java keystore 工具介绍

    http://www.javacodegeeks.com/2014/07/java-keystore-tutorial.html Table Of Contents 1. Introduction 2 ...

  5. cocos2d-x 关于opengl version too old 问题解决办法

    转载请注明出处 http://blog.csdn.net/u010229677/article/details/9704961 今天cocos2d-x突然出现这个对话框,去国外论坛找的解决办法.折腾许 ...

  6. Jakarta-Commons- BeanUtils学习笔记:

    http://www.cnblogs.com/zhangyi85/archive/2009/04/22/1441341.html 1.什么是BeanUtils: BeanUtils主要提供了对于Jav ...

  7. JSP和servlet结合案例

    [使用JSP技术实现猜数字游戏] 设计一个web app,有一个随机数字,给5次机会让客户猜测这个数字: 1)如果客户猜的数字比产生的数字值大,则提示"可惜,大了点". 2)如果客 ...

  8. Making the Elephant Dance: Strategic Enterprise Analysis

    http://www.modernanalyst.com/Resources/Articles/tabid/115/ID/2934/categoryId/23/Making-the-Elephant- ...

  9. MVC中一般为什么用IQueryable而不是用IList

    IList(IList<T>)会立即在内存里创建持久数据,这就没有实现“延期执行(deferred execution)”,如果被加载的实体有关联实体(associations),此关联实 ...

  10. 保存网页MHT

    uses ADODB_TLB, CDO_TLB, ComObj,MSHTML;{$R *.dfm}{能把网页如 WWW.QQ.COM保存为一个单文件 .MHT但不能把一个 A.HTM 保存为一个单文件 ...