爱易网
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 浏览次数:20218 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<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
上一篇:狡猾的按钮特效
下一篇:打开关闭框架
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
乐视28日发布手机进展 LeUI系统Mobile版或曝光
前苹果顾问批判iPhone命名:不应加S
银河证券王锦炎:金融业如何使用大数据
搜狐与奇虎360或结盟对抗BAT
靠谱分析:6月发生的WWDC和谷歌I/O大会,将会出现哪些新产品?
618首日看京东阿里不同策略,鹿死谁手?
亚马逊宣布新春大促策略 欲打造另一个"黑五"
从雷军的“互联网七字诀”告诉你一个非妖魔化的小米
承载京东C2C野心的拍拍网:梦想丰满,现实骨感
推荐阅读
更多>
华为、小米和联想在中国手机市场上演“三国杀”
马云寄厚望于物流 “菜鸟”行情暂难持续
评论:马云的成功建立在什么基础上很值得怀疑
三星已经将Galaxy S5视为失败之作?
三大运营商合建铁塔公司真相:未涉及电信业重组
苹果App Store被大量刷榜:iTunes账号成帮凶
评论:阿里为什么不试着收购一家香港媒体呢
联想架构调整后:Think品牌或推智能手机
团购网站存活率仅18.6% 剩余缺乏千家
传诺基亚5月14日发布会推出Lumia 950
刘强东:京东上市融资用于开拓三至六线城市
首批四款“官方”打车软件发布:均为安卓版本
虚拟运营商温度有多高?降温OR升温内外有别
工信部或本月17日向联通电信颁发FDD牌照
众贷网满月开张 网络金融监管再受质疑
迅雷向美SEC提交IPO招股书:拟最多筹资1亿美元
【晚报】女子泰国游晒10照片 流量费2000
美国政府关门可能影响去哪儿等公司IPO
百度吴恩达:图像和音视频搜索是人工智能新方向
HTC手机为何一败再败?效果出在供应链