网站首页
网站导航
Ctrl+D收藏
首 页
代码段
源码包
文档库
工具箱
代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
JS
】
鼠标经过显示大图
作者:
dezai
/ 发布于
2014/5/14
/
311
<script language="JavaScript" type="text/JavaScript"> function hideLayer() { var layer = document.getElementById("popImageLayer"); layer.style.visibility='hidden'; } function dispear(){ var layer = document.getElementById("popImageLayer"); if ((layer.style.width>0)&& (layer.style.height>0)){ layer.style.width-=1; layer.style.height-=1; } else { layer.style.visibility='hidden'; if (window.interval) clearInterval(interval); } } function popImage(obj,img,href) { var layer = document.getElementById("popImageLayer"); var t=obj.offsetTop; var l=obj.offsetLeft; while(obj=obj.offsetParent){ t+=obj.offsetTop; l+=obj.offsetLeft; } var content = "<table border=0 width=180 height=180><tr><td align='center' valign='middle'>\n"+ "<A href="+href+" target=_blank><IMG src='"+img+"' onload='DrawImage(this,180,180);' onMouseOut='low(this);hideLayer();' onMouseOver=high(this) style='FILTER: alpha(opacity=10)'></A></td></tr></table>"; // onClick='hideLayer();' layer.innerHTML=content; layer.style.left =l + 35 -90; layer.style.top = t+35-90; layer.style.visibility='visible'; } function moveToMouseLoc(e) { var layer = document.getElementById("popImageLayer"); var offsetX = -5; var offsetY = -5; var x = event.x + document.body.scrollLeft; var y = event.y + document.body.scrollTop; layer.style.left = x + offsetX; layer.style.top = y + offsetY; return true; } function DrawImage(img,width,height){ if(DrawImage.arguments.length <= 1) width=height=70; var image=new Image(); image.src=img.src; if(image.width>0 && image.height>0) { if(image.width>width) { rate=image.height/image.width; newHeight=rate*width; img.width=width; img.height=newHeight; } } if(img.height>height) { rate=image.width/image.height; newWidth=rate*height; img.height=height; img.width=newWidth; } } function DrawImage50(img){ DrawImage(img,50,50); } function resetForm(){ var f=document.frmsearch; f.Page.value = 1; f.ClassCode.value ='' ; f.SortType.value ='' ; f.KeyWord.value=''; f.Area.value=''; f.MinPrice.value=f.MaxPrice.value=''; return false; } function manualSearch(){ var f=document.frmsearch; f.Page.value = 1; // f.ClassCode.value ='' ; f.SortType.value ='' ; f.submit(); return false; } function checkCondition(obj) { return true; } function selectview(obj) { var f=document.frmsearch; if ((obj.selectedIndex>0) && (obj.selectedIndex <7)) f.SortType.value = obj.options[obj.selectedIndex].value; else if ((obj.selectedIndex>6) && (obj.selectedIndex <10)) f.View.value = obj.options[obj.selectedIndex].value; else if ((obj.selectedIndex>9) && (obj.selectedIndex <13)) f.PageSize.value = obj.options[obj.selectedIndex].value; f.submit(); return false; } function changeLocation(obj){ var f=document.frmsearch; f.Area.value = obj.options[obj.selectedIndex].value; f.submit(); return false; } function changeViewMode(mode){ var f=document.frmsearch; f.View.value = mode; f.submit(); return false; } function changePage(page){ var f=document.frmsearch; f.Page.value = page; f.submit(); return false; } function changePageSize(pagesize){ var f=document.frmsearch; f.Page.value = 1; f.PageSize.value = pagesize; f.submit(); return false; } function changeSortType(type){ var f=document.frmsearch; f.Page.value = 1; f.SortType.value = type; f.submit(); return false; } function changeClassCode(code){ var f=document.frmsearch; f.ClassCode.value = code; f.Page.value=1; f.submit(); return false; } function high(which2){ theobject=which2; highlighting=setInterval("highlightit(theobject)",40); } function low(which2){ clearInterval(highlighting); which2.filters.alpha.opacity=40; } function highlightit(cur2){ if (cur2.filters.alpha.opacity<100) cur2.filters.alpha.opacity+=5 else if (window.highlighting) clearInterval(highlighting) } function delightit(cur2){ if (cur2.filters.alpha.opacity>5) cur2.filters.alpha.opacity-=5; else if (window.highlighting) clearInterval(highlighting); } </script> <div id="popImageLayer" align="center" name="popImageLayer" style="position:absolute; visibility: hidden; width: 180; height: 180;cursor: hand;border-style:solid;border-width:1pt; border-color:orange" calss=""></div> <center> <img src="照片-0034.jpg" onMouseOver="popImage(this,'照片-0034.jpg','http://wangfenglitai.mall.dangdang.com/products/G00000072867.html');" border=0></a> <img src="照片-0034.jpg" onMouseOver="popImage(this,'照片-0034.jpg','http://wangfenglitai.mall.dangdang.com/products/G00000072867.html');" border=0></a> </center>
评论列表
本站所提供的代码,版权归原作者所有,若有侵犯作者版权,请与我们联系,我们将立即删除或修改。谢谢!
本站所有代码发布及提供者。
试试其它关键字
显示大图
同语言下
.
Jquery搜索框获取回车事件
.
H5页面添加倒计时,然后自动跳转
.
通过user-agent判断h5页面是在哪个手机App(QQ、微信
.
nginx 禁止未绑定的域名访问
.
JavaScript 获取按键,并屏蔽系统 Window 事件
.
H5之只允许微信浏览器打开,禁止从外部浏览器访问
.
微信打开网址添加在浏览器中打开提示的办法
.
实现JS复制、粘贴,Chrome/Firefox下可用
.
video视频播放,play()、pause()、duration时长、onen
.
HTML5实现MP3上传前的预览和播放时长的获取
可能有用的
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
.
实现对图片上传的接收
.
判断用户输入的是否为IP地址
dezai
贡献的其它代码
(
1065
)
.
双色球
.
列出所有物理网络适配器
.
快乐数的 Python 实现
.
计算当月还剩天数
.
猜属相
.
二十四小时时钟
.
每日一语
.
很酷的日历
.
超长日历表单
.
最简单的时钟
地图
本站
我们
服务
版权
联系
回馈
博客