网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
页面特效
> 正文
Google的265导航站上顶部右边的logo上的眼珠特效 (兼容IE,FF)
深山行者个人网站 2010/2/8 11:03:55 深山行者 字体:
大
中
小
浏览 9642
以上是所用的一些图片
google_265_logo_ig.js
以上是用到的JS代码
以下为详细代码
<html> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <title>Google的265导航站上顶部右边的logo上的眼珠特效 (兼容IE,FF)</title> <script src="/UploadFiles/demo/google_265_logo_ig.js"></script> </head> <body> <table cellpadding=0 cellspacing=0 border=0 align=center style="margin-top:200px;"> <tr> <td background="./UploadFiles/20100208/20100208110631979.gif"> <div style="width:117px;height:117px;"> <img src="./UploadFiles/20100208/20100208110639384.gif" width="15" height="15" style="position:relative;left:52px;top:52px;" id="EYES_pupil030"> </div> </td> <td background="./UploadFiles/20100208/20100208110622150.gif"> <div style="width:117px;height:117px;"> <img src="./UploadFiles/20100208/20100208110639384.gif" width="15" height="15" style="position:relative;left:52px;top:52px;" id="EYES_pupil130"> </div> </td> </tr> </table> <script type="text/javascript"> <!-- With thanks to Keith Packard and Jeremy Huxtable and Dylan Parker --> var EYES30 = { MAX_DIST : 37, // furthest pupil can move from center EYE_RADIUS : 59, // half the width of the eye image PUPIL_RADIUS : 7, // half the width of the pupil image pupils : [], init : function() { var app = EYES30; // setup our mousemove handler if (document.addEventListener) { document.addEventListener("mousemove", app.moveEyes, true); } else if (document.attachEvent) { document.attachEvent("onmousemove", app.moveEyes); } // grab references to the pupils app.pupils = [ _gel("EYES_pupil030"), _gel("EYES_pupil130") ]; // Call uninit when leaving page to cleanup the handlers _IG_AddEventHandler("unload", app.uninit); }, uninit : function() { var app = EYES30; // clean up our handlers if (document.addEventListener) { document.removeEventListener("mousemove", app.moveEyes, true); } else if (document.attachEvent) { document.detachEvent("onmousemove", app.moveEyes); } }, moveEyes : function(e) { if (!e) e = window.event; var app = EYES30; for (var i = 0; i < app.pupils.length; i++) { var pupil = app.pupils[i]; // The middle points of the eyes var midx = app.getPagePos(pupil.parentNode,true) + app.EYE_RADIUS; var midy = app.getPagePos(pupil.parentNode,false) + app.EYE_RADIUS; // The distX/distY from eye middles to the mouse var distX = e.clientX + document.body.scrollLeft - midx; var distY = e.clientY + document.body.scrollTop - midy; // The absolute distance from eye middles to the mouse var dist = Math.sqrt(Math.pow(distX, 2) + Math.pow(distY, 2)); if (dist > app.MAX_DIST) { // mouse out of eyeball, scale distX/distY to be at eyeball edge var scale = app.MAX_DIST / dist; distX *= scale; distY *= scale; } // Place the pupil appropriately pupil.style.left = parseInt(distX + app.EYE_RADIUS - app.PUPIL_RADIUS) + "px"; pupil.style.top = parseInt(distY + app.EYE_RADIUS - app.PUPIL_RADIUS) + "px"; } }, // get page coords for an element getPagePos : function(el, left) { var val=0; while(el != null) { val += el["offset"+(left?"Left":"Top")]; el = el.offsetParent; } return val; } }; EYES30.init(); </script> <!--[if lt IE 7]><script>if (typeof remote_modules == "undefined" && _gel("remote_30") != null) {_gel("remote_30").style.width = document.body.clientWidth + "px";}</script><![endif]-->如果眼睛没有动,请刷新页面,JS文件可能没有加载. </body> </html>
前一页:
按钮复制文章URL和复制保留文章的版权
后一页:
收集各种游览器禁止javascript的方法
相关阅读
连云港市海州区培智学校
一行内文本超出指定宽度溢出的处理
常见显示器尺寸与分辨率对照
asp获得系统Unix时间戳与将Unix时间戳转为正常日期
穿越火线风格-网吧留言本V4.3
缩写精简不必要的css定义代码来实现控制网页文件大小
计算文本框字节数
Asp得到当月天数的函数方法
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
DIV+CSS
HTML
python
更多>>
同类信息
jquery下拉到某个固定位置然后某些元素发生改变样式状态
canvas绘制的文字如何换行
兼容pc、移动端用js实现复制内容到剪切板(支持苹果safari浏览器)
js兼容多个浏览器右下角漂浮广告
兼容ie6+和火狐的禁止右键
做在线客服时,聊天窗口的div滚动条始终在底部
更多>>
最新添加文章
dw里面查找替换使用正则删除sqlserver里面的CONSTRAINT
Android移动端自动化测试:使用UIAutomatorViewer与Selenium定位元素
抖音直播音挂载小雪花 懂车帝小程序
javascript获取浏览器指纹可以用来做投票
火狐Mozilla Firefox出现:无法载入您的Firefox配置文件 它可能已经丢失 或是无法访问 问题解决集合处理办法
在Android、iOS、Windows、MacOS中微信小程序的文件存放路径
python通过代码修改pip下载源让下载库飞起
python里面requests.post返回的res.text还有其它的吗
更多>>
随机抽取信息
收集各种游览器禁止javascript的方法
广西亚太国际旅行社有限公司
微信公众号生成带参数的二维码asp源码下载
网上购物车购物数量加减效果
武汉辉煌国际旅行社
CSS光标属性一览表
更多标签
热门标签
png
超出
添加
过期
缓存
柱状
深山行者V1.2旅行社网站管理系统
web 2.0
素材
ctrl
日期
版权
点击
alert
连云港旅游
列表
web2.0
深山行者
网站地图
绿色
增大
后台
表格
对象
ewebeditor
media
加密
getElementById
翻滚
旅游
指向
list
随机
导航
游戏
link
onmouserout
青春
收藏
web
文件大小
创建
ajax
留言
绝对定位
参数
提示
tab
静态
宽
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号