爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
滚动效果
滚动效果
日期:2014-05-18 浏览次数:20254 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<HTML> <HEAD> <TITLE>滚动效果-爱易网WEB开发www.aiyiweb.com</TITLE> </HEAD> <BODY STYLE="overflow: hidden; border: 0" topmargin=0 leftmargin=0> <table> <tr><td style="padding: 5"> <div id="testDiv" style="border: buttonface 2 solid"> <img src="http://www.aiyiweb.com/UploadPic/userface/no1323.jpg" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/> </div> <script language="JScript"> function scroll(obj, oWidth, oHeight, direction, drag, zoom, speed) { var scrollDiv = obj var scrollContent = document.createElement("span") scrollContent.style.position = "absolute" scrollDiv.applyElement(scrollContent, "inside") var displayWidth = (oWidth != "auto" && oWidth ) ? oWidth : scrollContent.offsetWidth + parseInt(scrollDiv.currentStyle.borderRightWidth) var displayHeight = (oHeight != "auto" && oHeight) ? oHeight : scrollContent.offsetHeight + parseInt(scrollDiv.currentStyle.borderBottomWidth) var contentWidth = scrollContent.offsetWidth var contentHeight = scrollContent.offsetHeight var scrollXItems = Math.ceil(displayWidth / contentWidth) + 1 var scrollYItems = Math.ceil(displayHeight / contentHeight) + 1 scrollDiv.style.width = displayWidth scrollDiv.style.height = displayHeight scrollDiv.style.overflow = "hidden" scrollDiv.setAttribute("state", "stop") scrollDiv.setAttribute("drag", drag ? drag : "horizontal") scrollDiv.setAttribute("direction", direction ? direction : "left") scrollDiv.setAttribute("zoom", zoom ? zoom : 1) scrollContent.style.zoom = scrollDiv.zoom var scroll_script = "var scrollDiv = " + scrollDiv.uniqueID +"\n"+ "var scrollObj = " + scrollContent.uniqueID +"\n"+ "var contentWidth = " + contentWidth + " * (scrollObj.runtimeStyle.zoom ? scrollObj.runtimeStyle.zoom : 1)" +"\n"+ "var contentHeight = " + contentHeight + " * (scrollObj.runtimeStyle.zoom ? scrollObj.runtimeStyle.zoom : 1)" +"\n"+ "var scrollx = scrollObj.runtimeStyle.pixelLeft" +"\n"+ "var scrolly = scrollObj.runtimeStyle.pixelTop" +"\n"+ "switch (scrollDiv.state.toLowerCase())" +"\n"+ "{" +"\n"+ "case ('scroll') :" +"\n"+ "switch (scrollDiv.direction)" +"\n"+ "{" +"\n"+ "case ('left') :" +"\n"+ "scrollx = (--scrollx) % contentWidth" +"\n"+ "break" +"\n"+ "case ('right') :" +"\n"+ "scrollx = -contentWidth + (++scrollx) % contentWidth" +"\n"+ "break" +"\n"+ "case ('up') :" +"\n"+ "scrolly = (--scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('down') :" +"\n"+ "scrolly = -contentHeight + (++scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('left_up') :" +"\n"+ "scrollx = (--scrollx) % contentWidth" +"\n"+ "scrolly = (--scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('left_down') :" +"\n"+ "scrollx = (--scrollx) % contentWidth" +"\n"+ "scrolly = -contentHeight + (++scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('right_up') :" +"\n"+ "scrollx = -contentWidth + (++scrollx) % contentWidth" +"\n"+ "scrolly = (--scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "case ('right_down') :" +"\n"+ "scrollx = -contentWidth + (++scrollx) % contentWidth" +"\n"+ "scrolly = -contentHeight + (++scrolly) % contentHeight" +"\n"+ "break" +"\n"+ "defa
上一篇:狡猾的按钮特效
下一篇:打开关闭框架
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
继续涨:微博IPO第二交易日 收盘大涨11.71%
富士康人事故骚动方寸 不惜血本下注电商
云智慧:用大数据实现企业应用性能管理
NoomWeight减肥
蓝宝石PK大猩猩玻璃:作为屏幕谁更有优势?
全球五大电信设备商业绩:华为净利居首
猎豹移动上市押海外市场 与小米有合作空间
从百度世界大会看大数据
用户喊话当当网:我彻底把你们丢弃了
推荐阅读
更多>
微博启动自媒体计划 粉丝+收入双激励是亮点
三星维修新规:Galaxy S4主板进水也收费修
京东物流"最后一公里":颠覆阿里或者被阿里干掉
打车软件火了 恶性循环来了
公信力消失:马航事件社交媒体传播之痛
搜狐与奇虎360或结盟对抗BAT
原万网CTO周雷加盟亿玛 出任CTO一职
人们为什么总愿尝试新社交网络?
云储存有多远:跨过数据安全问题即可到达
前苹果顾问批判iPhone命名:不应加S
诺基亚若没加入微软,只不过是另一个HTC而已
中移动将推出多项4G资费新政
OPPO Find7体验测 Find7综测
国内云服务商存在尴尬:“远程机房+移动大硬盘”模式
火一把就死: 百度魔图验证社交游戏衰亡宿命
搜狐前副总编何毅加盟乐视 任车联网公司CEO
雷军会做赔钱生意?迅雷跌破发行价 市值仅7亿美元
微软确认 Surface 计划更多尺寸和LTE 版本
支付宝钱包支持医保移动缴费 广州成首个试点
全球网络遭史上最大规模攻击:攻击数据每秒300G