我是靠谱客的博主 幽默雪糕,这篇文章主要介绍JQuery实现鼠标移动到图片上显示边框效果,现在分享给大家,希望可以做个参考。

复制代码 代码如下:

以下为程序代码:<!DOCTYPE html/>
<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://www.uoften.com/uploadfile/2018/0411/20180411011407300.jpg" border="0" class="v" /></a>
<a href="#"><img src="http://www.uoften.com/uploadfile/2018/0411/20180411011407300.jpg" border="0" /></a>
<a href="#"><img src="http://www.uoften.com/uploadfile/2018/0411/20180411011407300.jpg" border="0" class="v" /></a>
</body>
</html>

点击查看演示:http://biyuan.tk/u/upload/201311131123292656.html

最后

以上就是幽默雪糕最近收集整理的关于JQuery实现鼠标移动到图片上显示边框效果的全部内容,更多相关JQuery实现鼠标移动到图片上显示边框效果内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(101)

评论列表共有 0 条评论

立即
投稿
返回
顶部