JQuery实现鼠标移动到图片上显示边框效果 - Web前端
作者:98wpeu发布时间:2026-07-27分类:网页前端技术浏览:7
导读:复制代码代码如下:以下为程序代码:<!DOCtypehtml/><head><scripttype="text/javascript"src...
复制代码 代码如下:
以下为程序代码:<!DOCtypehtml/>
<head>
<script type="text/javascript" src="http://www.w3school.com.cn/JQuery/jQuery.JS"></script>
<script type="text/JavaScript">
$(function() {
$(".v").mouSEOver(function() {
var x = $("<div class='vs'></div>");
x.appendTo($('body'));
x.CSS({
width : $(this).width() - 6,
height : $(this).height() - 6,
left : $(this).offset().left,
top : $(this).offset().top
});
$($.browser.msie ? this : x).mouseout(function(){
x.remove();
});
});
});
</script>
<style>
.vs {z-index:1000;position:absolute;border:3px solid red;}
</style>
</head>
<body>
<a href="#"><img src="HTTP://img2.bdstatic.com/img/image/774730e0cf3D7ca7bcb7a7b223ebc096b63f624a89b.jpg" border="0" class="v" /></a>
<a href="#"><img src="http://img2.bdstatic.com/img/image/774730e0cf3d7ca7bcb7a7b223ebc096b63f624a89b.jpg" border="0" /></a>
<a href="#"><img src="http://img2.bdstatic.com/img/image/774730e0cf3d7ca7bcb7a7b223ebc096b63f624a89b.jpg" border="0" class="v" /></a>
</body>
</HTML>
点击查看演示:http://biyuan.tk/u/upload/201311131123292656.html
以下为程序代码:<!DOCtypehtml/>
<head>
<script type="text/javascript" src="http://www.w3school.com.cn/JQuery/jQuery.JS"></script>
<script type="text/JavaScript">
$(function() {
$(".v").mouSEOver(function() {
var x = $("<div class='vs'></div>");
x.appendTo($('body'));
x.CSS({
width : $(this).width() - 6,
height : $(this).height() - 6,
left : $(this).offset().left,
top : $(this).offset().top
});
$($.browser.msie ? this : x).mouseout(function(){
x.remove();
});
});
});
</script>
<style>
.vs {z-index:1000;position:absolute;border:3px solid red;}
</style>
</head>
<body>
<a href="#"><img src="HTTP://img2.bdstatic.com/img/image/774730e0cf3D7ca7bcb7a7b223ebc096b63f624a89b.jpg" border="0" class="v" /></a>
<a href="#"><img src="http://img2.bdstatic.com/img/image/774730e0cf3d7ca7bcb7a7b223ebc096b63f624a89b.jpg" border="0" /></a>
<a href="#"><img src="http://img2.bdstatic.com/img/image/774730e0cf3d7ca7bcb7a7b223ebc096b63f624a89b.jpg" border="0" class="v" /></a>
</body>
</HTML>
点击查看演示:http://biyuan.tk/u/upload/201311131123292656.html
相关推荐
- jquery中each方法示例和常用选择器 - Web前端
- jquery操作checkbox示例分享 - Web前端
- jquery 页眉单行信息滚动显示实现思路及代码 - Web前端
- 解决checkbox的attr(checked)一直为undefined问题 - Web前端
- 多种方法实现360浏览器下禁止自动填写用户名密码 - Web前端
- Jquery自定义button按钮的几种方法 - Web前端
- jQuery.extend()、jQuery.fn.extend()扩展方法示例详解 - Web前端
- jQuery判断复选框是否勾选的原理及示例 - Web前端
- jQuery图片切换插件jquery.cycle.js使用示例 - Web前端
- 一个可以增加和删除行的table并可编辑表格中内容 - Web前端
- 网页前端技术排行
-
- 1[Web前端]用javascript实现默认图片替代未显示的图片 - Web前端
- 2分析Iconfont-阿里巴巴矢量常用图标库 - Web前端
- 3【第六章】Foundation之按钮和下拉功能 - Web前端
- 4基于jquery的滚动条滚动固定div(附演示下载) - Web前端
- 5jQuery实例教程:制作网页中可折叠的面板 - Web前端
- 6jQuery编写widget的一些技巧分享 - Web前端
- 7jQuery实现鼠标移到元素上动态提示消息框效果 - Web前端
- 8在Mac/PC上远程调试iPhone/iPad上的网页 - Web前端
- 9分享精心挑选的12款优秀jQuery Ajax分页插件和教程 - Web前端
- 最近发表
-
- WordPress随机显示特色图片插件:Random Post Thumbnails
- KeePass实现Chrome浏览器自动填充密码方法一
- LNMP一键包nginx 301强制跳转到https教程
- KeePass实现Chrome浏览器自动填充密码方法二
- #建站# 免费的VPS管理软件Xshell8/Xftp8中文版下载
- 使用Xshell 8连接VPS教程_电脑登录vps的方法
- WordPress评论界面添加烟花????效果
- 不同浏览器书签同步方案:坚果云+Floccus_详细使用教程
- iOS端KeePassXC客户端APP:Strongbox Password Safe
- 给WordPress评论中的Gravatar头像图片添加ALT属性


