本文主要介绍了jQuery鼠标悬停内容动画切换效果的实例。具有很好的参考价值。下面跟着小编一起来看下吧,希望能帮助到大家。
效果如下:
代码如下:
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>jQuery鼠标悬停内容动画切换效果</title> <style> * { margin: 0; padding: 0; list-style: none; } img { border: 0; } a { color: #fff; text-decoration: none; } .servicesBox { width: 1000px; height: 270px; margin: 0 auto; clear: both; line-height: 18px; color: #999999; font-size: 12px; } .servicesBox .serBox { cursor: pointer; border: 1px solid #fff; display: inline; width: 198px; height: 250px; float: left; overflow: hidden; background-color: #f7f7f7; position: relative; } .servicesBox .serBoxOn { font-family: "Microsoft Yahei"; display: none; width: 320px; height: 270px; background: url(http://demo.lanrenzhijia.com/2014/pic0910/images/serboxon_bg.gif) repeat 0px 0px; position: absolute; left: 0px; top: 0px; z-index: 19; } .servicesBox .serBox .pic1 { width: 110px; height: 110px; text-align: center; position: absolute; top: 22px; right: 41px; z-index: 99; } .servicesBox .serBox .pic2 { width: 110px; height: 110px; text-align: center; position: absolute; top: 22px; left: -110px; z-index: 99; } .servicesBox .serBox .txt1 { width: 198px; height: 100px; color: #999999; position: absolute; top: 145px; left: 0px; z-index: 99; } .servicesBox .serBox .txt2 { width: 198px; height: 100px; color: #a9cf4f; position: absolute; top: 145px; right: -240px; z-index: 99; } .servicesBox .serBox span.tit { font-size: 16px; display: block; text-align: center; } .servicesBox .serBox .txt1 .tit { color: #000000; line-height: 30px; } .servicesBox .serBox .txt2 .tit { color: #fff; line-height: 30px; font-family: "Microsoft Yahei"; } .servicesBox .serBox p { padding: 0 10px; text-align: center; } </style> </head> <body> <!-- 代码begin --> <p class="servicesBox"> <p id="p35" class="serBox" onclick="serFocus(1)"> <p class="serBoxOn"></p> <p class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/3.png"> </p> <p class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/3-3.png"> </p> <p class="txt1"> <span class="tit">开心网</span> <p>开心网营销</p> </p> <p class="txt2"> <a href="http://www.lanrenzhijia.com" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">开心网</span> <p>开心网营销</p> </a> </p> </p> <p id="p36" class="serBox" onclick="serFocus(2)"> <p class="serBoxOn"></p> <p class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/1.png"> </p> <p class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/1-1.png"> </p> <p class="txt1"> <span class="tit">人人网</span> <p>人人网营销</p> </p> <p class="txt2"> <a href="http://www.lanrenzhijia.com" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">人人网</span> <p>人人网营销</p> </a> </p> </p> <p id="p37" class="serBox" onclick="serFocus(3)"> <p class="serBoxOn"></p> <p class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/2.png"> </p> <p class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/2-2.png"> </p> <p class="txt1"> <span class="tit">QQ空间</span> <p>QQ空间营销</p> </p> <p class="txt2"> <a href="http://www.lanrenzhijia.com" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">QQ空间</span> <p>QQ空间营销</p> </a> </p> </p> <p id="p38" class="serBox" onclick="serFocus(3)"> <p class="serBoxOn"></p> <p class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/35.png"> </p> <p class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/35-35.png"> </p> <p class="txt1"> <span class="tit">问答营销</span> <p>问答投放 锁住潜在客户</p> </p> <p class="txt2"> <a href="http://www.lanrenzhijia.com" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">问答营销</span> <p>问答投放 锁住潜在客户</p> </a> </p> </p> <p id="p39" class="serBox" onclick="serFocus(3)"> <p class="serBoxOn"></p> <p class="pic1 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/31.png"> </p> <p class="pic2 mypng"> <img src="http://demo.lanrenzhijia.com/2014/pic0910/images/31-31.png"> </p> <p class="txt1"> <span class="tit">邮件推广</span> <p>低成本 商机无限</p> </p> <p class="txt2"> <a href="http://www.lanrenzhijia.com" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="a_jump"><span class="tit">邮件推广</span> <p>低成本 商机无限</p> </a> </p> </p> </p> <script src="http://www.lanrenzhijia.com/ajaxjs/jquery.min.js"></script> <script> $(function() { $(".serBox").hover( function() { $(this).children().stop(false, true); $(this).children(".serBoxOn").fadeIn("slow"); $(this).children(".pic1").animate({ right: -110 }, 400); $(this).children(".pic2").animate({ left: 41 }, 400); $(this).children(".txt1").animate({ left: -240 }, 400); $(this).children(".txt2").animate({ right: 0 }, 400); }, function() { $(this).children().stop(false, true); $(this).children(".serBoxOn").fadeOut("slow"); $(this).children(".pic1").animate({ right: 41 }, 400); $(this).children(".pic2").animate({ left: -110 }, 400); $(this).children(".txt1").animate({ left: 0 }, 400); $(this).children(".txt2").animate({ right: -240 }, 400); } ); }); </script> <!-- 代码end --> </body> </html>
相关推荐:
以上是jQuery鼠标悬停内容动画切换效果实现代码的详细内容。更多信息请关注PHP中文网其他相关文章!

MySQL函数可用于数据处理和计算。1.基本用法包括字符串处理、日期计算和数学运算。2.高级用法涉及结合多个函数实现复杂操作。3.性能优化需避免在WHERE子句中使用函数,并使用GROUPBY和临时表。

MySQL批量插入数据的高效方法包括:1.使用INSERTINTO...VALUES语法,2.利用LOADDATAINFILE命令,3.使用事务处理,4.调整批量大小,5.禁用索引,6.使用INSERTIGNORE或INSERT...ONDUPLICATEKEYUPDATE,这些方法能显着提升数据库操作效率。

在MySQL中,添加字段使用ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column,删除字段使用ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop。添加字段时,需指定位置以优化查询性能和数据结构;删除字段前需确认操作不可逆;使用在线DDL、备份数据、测试环境和低负载时间段修改表结构是性能优化和最佳实践。

使用EXPLAIN命令可以分析MySQL查询的执行计划。1.EXPLAIN命令显示查询的执行计划,帮助找出性能瓶颈。2.执行计划包括id、select_type、table、type、possible_keys、key、key_len、ref、rows和Extra等字段。3.根据执行计划,可以通过添加索引、避免全表扫描、优化JOIN操作和使用覆盖索引来优化查询。

子查询可以提升MySQL查询效率。1)子查询简化复杂查询逻辑,如筛选数据和计算聚合值。2)MySQL优化器可能将子查询转换为JOIN操作以提高性能。3)使用EXISTS代替IN可避免多行返回错误。4)优化策略包括避免相关子查询、使用EXISTS、索引优化和避免子查询嵌套。

在MySQL中配置字符集和排序规则的方法包括:1.设置服务器级别的字符集和排序规则:SETNAMES'utf8';SETCHARACTERSETutf8;SETCOLLATION_CONNECTION='utf8_general_ci';2.创建使用特定字符集和排序规则的数据库:CREATEDATABASEexample_dbCHARACTERSETutf8COLLATEutf8_general_ci;3.创建表时指定字符集和排序规则:CREATETABLEexample_table(idINT

要安全、彻底地卸载MySQL并清理所有残留文件,需遵循以下步骤:1.停止MySQL服务;2.卸载MySQL软件包;3.清理配置文件和数据目录;4.验证卸载是否彻底。

MySQL中重命名数据库需要通过间接方法实现。步骤如下:1.创建新数据库;2.使用mysqldump导出旧数据库;3.将数据导入新数据库;4.删除旧数据库。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

SublimeText3 Linux新版
SublimeText3 Linux最新版

SublimeText3汉化版
中文版,非常好用

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器

安全考试浏览器
Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具