jQuery实现鼠标经过显示动画边框特效


Posted in jQuery onMarch 24, 2017

原效果用addClass 改为slideUp,纯学习

效果图:

jQuery实现鼠标经过显示动画边框特效

代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <link rel="stylesheet" type="text/css" href="css.css" rel="external nofollow" >
 <title>Document</title>
</head>
<body>
 <style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
a{color:#000;text-decoration: none;font-weight: 600}
body{font:12px/180% Arial, Helvetica, sans-serif, "新宋体";}
.sph{
 width: 1300px;
 margin: 0 auto;
 padding: 100px 0;
}
.spbq{
 width: 250px;
 height: 250px;
 float: left;
 line-height: 2;
 padding: 10px 10px 0 20px;
 margin: 20px;
 position: relative;
 overflow: hidden;
}
.spbq h2{
 color: #14191e;
 font: bold 14px/18px "Microsoft Yahei","Hiragino Sans GB",Helvetica,"微软雅黑",Tahoma,Arial,sans-serif;
 margin-top: 18px;
}
.spbq span{
 display: block;
 color: #b4bbbf;
 font: 12px/18px "Microsoft Yahei","Hiragino Sans GB",Helvetica,"微软雅黑",Tahoma,Arial,sans-serif;
 margin: 8px 0;
}
.spbq b{
 color: #787d82;
 font: 12px/18px "Microsoft Yahei","Hiragino Sans GB",Helvetica,"微软雅黑",Tahoma,Arial,sans-serif;
}
.biankuang{
 width: 3px;
 height: 3px;
 position: absolute;
 z-index: 99;
 border-radius:10px;
 /*background: black;*/
}
.biankuang_1{
 height: 3px;
 top: -6px;
 left:0px;
 border-left: 3px solid #EB5858;
}
.biankuang_2 {
 width: 0px;
 bottom:-3px;
 left: 0px;
 border-top: 3px solid #EB5858;
}
.biankuang_3{
 height: 0px;
 bottom:0px;
 right:0px;
 border-right: 3px solid #EB5858;
}
.biankuang_4{
 width:0px;
 top:-3px;
 right:0px;
 border-bottom: 3px solid #EB5858;
}
.text_gobuy {
 position: absolute;
 z-index: 9;
 bottom: 0;
 left: 0px;
 width: 280px;
 height: 50px;
 overflow: hidden;
 background-color: rgba(32, 32, 33,0.5);
 cursor: pointer;
 display: none;
 text-align: center;
}
.text_gobuy_show{
padding: 20px 15px ;
opacity: 1;
}
.spbq p{
 position: absolute;
 bottom:10px;
 left:110px;
 line-height: 33px;
 color: #fff
}
</style>
</head>
<body>
<div class="sph">
 <div class="spbq">
 <div class="biankuang biankuang_1"></div>
 <div class="biankuang biankuang_2"></div>
 <div class="biankuang biankuang_3"></div>
 <div class="biankuang biankuang_4"></div>
 <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ><div class="zst"><img src="http://www.jq22.com/demo/jQuery-hover20161208/images/0-135.jpg" alt=""></div><h2>jQuery基础课程</h2><span>让jQuery带您进入网页动态交互世界,为...</span><b>更新完毕    15783人学习</b></a>
 <div class="text_gobuy">
  <br/>
  <p>9小时17分钟 | 初级</p>
  <br/>
 </div>
 </div>
 <div class="spbq">
 <div class="biankuang biankuang_1"></div>
 <div class="biankuang biankuang_2"></div>
 <div class="biankuang biankuang_3"></div>
 <div class="biankuang biankuang_4"></div>
 <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ><div class="zst"><img src="http://www.jq22.com/demo/jQuery-hover20161208/images/0-135.jpg" alt=""></div><h2>jQuery基础课程</h2><span>让jQuery带您进入网页动态交互世界,为...</span><b>更新完毕    15783人学习</b></a>
 <div class="text_gobuy">
  <br/>
  <p>9小时17分钟 | 初级</p>
  <br/>
 </div>
 </div> 
 <div class="spbq">
 <div class="biankuang biankuang_1"></div>
 <div class="biankuang biankuang_2"></div>
 <div class="biankuang biankuang_3"></div>
 <div class="biankuang biankuang_4"></div>
 <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ><div class="zst"><img src="http://www.jq22.com/demo/jQuery-hover20161208/images/0-135.jpg" alt=""></div><h2>jQuery基础课程</h2><span>让jQuery带您进入网页动态交互世界,为...</span><b>更新完毕    15783人学习</b></a>
 <div class="text_gobuy">
  <br/>
  <p>9小时17分钟 | 初级</p>
  <br/>
 </div>
 </div>
 <div class="spbq">
 <div class="biankuang biankuang_1"></div>
 <div class="biankuang biankuang_2"></div>
 <div class="biankuang biankuang_3"></div>
 <div class="biankuang biankuang_4"></div>
 <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ><div class="zst"><img src="http://www.jq22.com/demo/jQuery-hover20161208/images/0-135.jpg" alt=""></div><h2>jQuery基础课程</h2><span>让jQuery带您进入网页动态交互世界,为...</span><b>更新完毕    15783人学习</b></a>
 <div class="text_gobuy">
  <br/>
  <p>9小时17分钟 | 初级</p>
  <br/>
 </div>
 </div>
</div>  
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script> 
<script type="text/javascript">
function biankuang(obj) {
  $(obj).find('.biankuang_1').stop(true).animate({
      height: '305px'
    },
    300)
  $(obj).find('.biankuang_2').stop(true).delay('300').animate({
      width: '305px'
    },
    300)
  $(obj).find('.biankuang_3').stop(true).animate({
      height: '305px'
    },
    300)
  $(obj).find('.biankuang_4').stop(true).delay('300').animate({
      width: '305px'
    },
    300)
}
function biankuang1(obj) {
  $(obj).find('.biankuang_1').animate({
      height: '0'
    },
    100)
  $(obj).find('.biankuang_2').animate({
      width: '0'
    },
    100)
  $(obj).find('.biankuang_3').animate({
      height: '0'
    },
    100)
  $(obj).find('.biankuang_4').animate({
      width: '0'
    },
    100)
}
$('.spbq').hover(function() {
  var obj = $(this);
  obj.find('.text_gobuy').slideDown(300);
  biankuang(obj);
}, function() {
  var obj = $(this);
  obj.find('.text_gobuy').slideUp(300);
  biankuang1(obj);
})
</script>
</body>
</html>

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持三水点靠木!

jQuery 相关文章推荐
JQuery实现定时刷新功能代码
May 09 jQuery
各种选择框jQuery的选中方法(实例讲解)
Jun 27 jQuery
jQuery实现checkbox的简单操作
Nov 18 jQuery
jquery ajaxfileupload异步上传插件
Nov 21 jQuery
jQuery实现右侧抽屉式在线客服功能
Dec 25 jQuery
jQuery中图片展示插件highslide.js的简单dom
Apr 22 jQuery
jQuery pagination分页示例详解
Oct 23 jQuery
JQuery获取元素尺寸、位置及页面滚动事件应用示例
May 14 jQuery
jQuery事件委托代码实践详解
Jun 21 jQuery
jQuery表单选择器用法详解
Aug 22 jQuery
jQuery-App输入框实现实时搜索
Nov 19 jQuery
HTML5+jQuery实现搜索智能匹配功能
Mar 24 #jQuery
jQuery实现的动态文字变化输出效果示例【附演示与demo源码下载】
Mar 24 #jQuery
原生Aajax 和jQuery Ajax 写法个人总结
Mar 24 #jQuery
jQuery实现的背景颜色渐变动画效果示例
Mar 24 #jQuery
jQuery插件FusionCharts实现的MSBar2D图效果示例【附demo源码】
Mar 24 #jQuery
jQuery编写textarea输入字数限制代码
Mar 23 #jQuery
jquery实现全选、全不选以及单选功能
Mar 23 #jQuery
You might like
php 生成短网址原理及代码
2014/01/23 PHP
PHP使用mysql_fetch_row查询获得数据行列表的方法
2015/03/18 PHP
php并发加锁示例
2016/10/17 PHP
Laravel关联模型中过滤结果为空的结果集(has和with区别)
2018/10/18 PHP
Ajax+PHP实现的模拟进度条功能示例
2019/02/11 PHP
关于laravel模板中生成URL的几种模式总结
2019/10/18 PHP
jQuery动态地获取系统时间实现代码
2013/05/24 Javascript
理解javascript异步编程
2016/01/27 Javascript
jQuery 如何给Carousel插件添加新的功能
2016/04/18 Javascript
Bootstrap Navbar Component实现响应式导航
2016/10/08 Javascript
angular.js和vue.js中实现函数去抖示例(debounce)
2018/01/18 Javascript
基于 Immutable.js 实现撤销重做功能的实例代码
2018/03/01 Javascript
Javascript实现异步编程的过程
2018/06/18 Javascript
vue实现文件上传读取及下载功能
2020/11/17 Javascript
js实现百度登录窗口拖拽效果
2020/03/19 Javascript
微信小程序实现可拖动悬浮图标(包括按钮角标的实现)
2020/12/29 Javascript
[13:39]2014 DOTA2华西杯精英邀请赛 5 25 NewBee VS DK第一场
2014/05/26 DOTA
[04:51]TI10典藏宝瓶Ⅱ外观视频展示
2020/08/15 DOTA
Python中函数的用法实例教程
2014/09/08 Python
Python中动态创建类实例的方法
2017/03/24 Python
python实现监控某个服务 服务崩溃即发送邮件报告
2018/06/21 Python
pycharm 2019 最新激活方式(pycharm破解、激活)
2020/09/22 Python
美国受信赖的教育产品供应商:Nest Learning
2018/06/14 全球购物
化工专业应届生求职信
2013/11/08 职场文书
商务英语专业求职信范文
2014/01/28 职场文书
汉语言文学毕业生自荐信范文
2014/03/24 职场文书
服务理念口号
2014/06/11 职场文书
韩语专业职业生涯规划范文:成功之路就在我们脚下
2014/09/11 职场文书
2014年店长工作总结
2014/11/17 职场文书
2014年电厂工作总结
2014/12/04 职场文书
公务员考察材料范文
2014/12/23 职场文书
社区环境卫生倡议书
2015/04/29 职场文书
2015财务年终工作总结范文
2015/05/22 职场文书
党员证明模板
2015/06/19 职场文书
python编写函数注意事项总结
2021/03/29 Python
分享python函数常见关键字
2022/04/26 Python