网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
页面特效
> 正文
Google的265导航站上顶部右边的logo上的眼珠特效 (兼容IE,FF)
深山行者个人网站 2010/2/8 11:03:55 深山行者 字体:
大
中
小
浏览 11512
以上是所用的一些图片
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的方法
相关阅读
爱度旅行网
在Android、iOS、Windows、MacOS中微信小程序的文件存放路径
新乡市神州国际旅行社
asp中eof的介绍
洪江市道德模范评选 - 网络投票
更变态的页面右击失效代码,选择,全选,全部失效
连云港旅游网
默认系统
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
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还有其它的吗
更多>>
随机抽取信息
windows8的iis7应用程序池标识问题
抖音直播音挂载小雪花 懂车帝小程序
微信小程序直播组件live-player-plugin(wx2b03c6e691cd7370)
层展开/关闭 - 运动缓冲效果
网站需要SEO 基本的SEO建站要点
8种Python字符串拼接的方法,你知道几种
更多标签
热门标签
阴影效果
下载
window
文字垂直居中
html
flush
绝对
自动获取
页面
密码
三级
DIV CSS做的透明菜单兼容IE、FF等
px
在线
压缩
控件
文字垂直
灰色
留言板模版
留言板
游览器
对象
max
深山行者
Excel
像素
翻滚
textarea
文字样式
调色板
失效
等待
百度
爱墙
屏幕
关联
快捷键
hack
Application
日历
PSD
openwin
缩略图
alert
版权
submit
状态栏
市
全选
资料
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号