网站首页
关于深山
客户案例
业务范围
联系深山
网络投票系统
企业网站建设
旅行社网站建设
小程序
留言板
技术文章
许愿墙(qq爱墙)
技术首页
百度小程序开发
微信小程序开发
微信公众号开发
uni-app
asp函数库
ASP
asp.net
DIV+CSS
HTML
SEO搜索引擎忧化
下载类信息
个人空间
代码生成
电商
python
页面特效
表格特效
导航菜单
图形特效
表单特效
时间日期
色彩类别
链接特效
网页特效
系统硬件
网站公告
网页学习
技术类文章
网站类信息
订阅本栏目 RSS
您所在的位置:
深山工作室
>
页面特效
> 正文
Google的265导航站上顶部右边的logo上的眼珠特效 (兼容IE,FF)
深山行者个人网站 2010/2/8 11:03:55 深山行者 字体:
大
中
小
浏览 11504
以上是所用的一些图片
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的方法
相关阅读
延边金桥国际旅行社有限公司
用于深山在线投票的一个javascript统计checkbox现在选中的个数一边点复选框一边验证并计算现在选了多少个复选框
input输入框的一些属性详解
请勿在本地站发布乱七八糟的广告,本站所有的留言与评论全是需要审核的
CSS代码格式化和压缩化
安卓版微信中播放视频不自动全屏
闪客精灵下载
旅游线路系统
更多信息>>
栏目类别选择
百度小程序开发
微信小程序开发
微信公众号开发
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还有其它的吗
更多>>
随机抽取信息
越狱ios老应用老游戏合集下载
pywinauto技术文档
深山留言板 v7.0.1 bulid2014.11.15更新
cookies
利用Asp里的xmlhttp组件来获取页面内容
广西亚太国际旅行社有限公司
更多标签
热门标签
页面
绝对管用的iis安装包下载
插件
选项
下划线
阴影效果
126
link
源码
逗号
规则
mssql
Cookie
省略
函数
强度
右键失效
important
翻滚
创建
产品
email
旅行社
失效
表单
用户体验
innerHTML
建立日期
html
open
深山旅游网站管理系统V1.0
柱状
DIV+CSS做的透明菜单兼容IE、FF等
心情
添加
访问量
脚本
文化
日历
详解
游览器
电脑
ul
tags
JS效果
字体
营销
操作
FlashFxp
javascri
免责声明:本站所有资料信息,有部分为本人原创,部分为从网络收集而来,仅供网友查看阅读所用,所有信息版权归信息所有人或所有公司所有
如果信息内容侵犯到您的版权或权益请与我们联系,经确认后我们会立即移除相关内容或链接
Copyright © 2007-2026
深山工作室
All Rights Reserved
服务QQ:
565449214
手机:
13961347334
ICP备案:
苏ICP备15019627号
苏公网安备 32070502010230号