jQuery实现鼠标经过时高亮,同时其他同级元素变暗的效果
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了jQuery实现鼠标经过时高亮,同时其他同级元素变暗的效果,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2053字,纯文字阅读大概需要3分钟。
内容图文
![jQuery实现鼠标经过时高亮,同时其他同级元素变暗的效果](/upload/InfoBanner/zyjiaocheng/350/03a3341c6f1d4b68ad1c8ee5a560a77b.jpg)
本文实例讲述了jQuery实现鼠标经过时高亮,同时其他同级元素变暗的效果。分享给大家供大家参考,具体如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"/> <meta name="keywords" content="关键词1,关键词2,关键词3等等"/> <title>鼠标经过时高亮,其他的暗</title> <style type="text/css"> *{margin:0; padding:0;} ul,li{list-style:none;} ul{width:900px; height:200px; margin:100px auto;} li{width:200px; height:200px; display:inline-block; border:1px solid #d8d8d8; position:relative;} .addblack{width:200px; height:200px; display:none; background:#000;filter: alpha(opacity=10);-moz-opacity: 0.1; opacity: 0.1; position:absolute; left:0; top:0;} </style> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".index_Img").hover(function(){ $(this).siblings().find(".addblack").show(); },function(){ $(this).siblings().find(".addblack").hide(); $(this).find(".addblack").hide(); }) }) </script> </head> <body> <ul> <li class="index_Img"> 苹果 <div class="addblack" style="left: 0px; top: 0px; width: 200px; height: 200px; display: none;"></div> </li> <li class="index_Img"> 香蕉 <div class="addblack" style="left: 0px; top: 0px; width: 200px; height: 200px; display: none;"></div> </li> <li class="index_Img"> 葡萄 <div class="addblack" style="left: 0px; top: 0px; width: 200px; height: 200px; display: none;"></div> </li> <li class="index_Img"> 凤梨 <div class="addblack" style="left: 0px; top: 0px; width: 200px; height: 200px; display: none;"></div> </li> </ul> </body> </html>
运行效果图如下:
更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery切换特效与技巧总结》、《jQuery遍历算法与技巧总结》、《jQuery扩展技巧总结》、《jQuery常用插件及用法总结》、《jQuery拖拽特效与技巧总结》、《jQuery表格(table)操作技巧汇总》、《jquery中Ajax用法总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》及《jquery选择器用法总结》
希望本文所述对大家jQuery程序设计有所帮助。
内容总结
以上是互联网集市为您收集整理的jQuery实现鼠标经过时高亮,同时其他同级元素变暗的效果全部内容,希望文章能够帮你解决jQuery实现鼠标经过时高亮,同时其他同级元素变暗的效果所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。