联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > 网页前端技术 > 正文

JQuery实现鼠标移动到图片上显示边框效果 - Web前端

作者:98wpeu发布时间:2026-07-27分类:网页前端技术浏览:1


导读:复制代码代码如下:以下为程序代码:<!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

标签:鼠标边框效果图片WebJQuery


网页前端技术排行
最近发表
网站分类
标签列表