本效果使用jQuery和CSS实现了图片列表,当鼠标移入时图片向左微动,移出则复原。
其中的jQuery事件使用mouseenter 和 mouseleave ,事件绑定方法使用新推荐的on方法。
代码如下:
<!DOCTYPE html>
<html>
<head><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>jQuery实现图片列表鼠标移入微动_何问起</title><base target="_blank" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body, div, li, p, img, a {
margin: 0;
padding: 0;
}
.hovertreecontainer {
width: 370px;
margin: 50px auto;
}
.hovertreecontainer a {
text-decoration: none;
}
.hovertree-item-box {
height: 120px;
width: 185px;
position: relative;
padding: 10px;
box-sizing: border-box;
float: left;
}
.hovertree-item-box .title {
width: 80px;
height: 100%;
color: #4998a1;
font-size: 14px;
}
.hovertree-item-box.odd {
border-bottom: 1px solid #CCC;
border-right: 1px solid #CCC;
}
.hovertree-item-box.even {
border-bottom: 1px solid #CCC;
}
.hovertree-item-box.nobottom {
border-bottom: none;
}
.hovertree-item-box .hovertree-img-box {
width: 80px;
height: 80px;
overflow: hidden;
position: absolute;
right: 10px;
bottom: 5px;
}
.hovertree-img-box img {
width: 100%;
height: 100%;
}
.hovertreecontainer:after {
content: "";
display: block;
clear: both;
}
</style>
</head>
<body>
<div class="hovertreecontainer"><h2>jQuery实现图片列表鼠标移入微动</h2>
<a href="http://hovertree.com/texiao/css/20/">
<div class="hovertree-item-box odd">
<div class="title">春节对联</div>
<div class="hovertree-img-box"><img src="/UploadFiles/2021-04-02/o9qashmi.gif">
以上就是本文的全部内容,希望对大家有所帮助,同时也希望多多支持!
标签:
jquery,图片列表,微动
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
白云城资源网 Copyright www.dyhadc.com
暂无“jquery实现图片列表鼠标移入微动”评论...
更新日志
2025年10月27日
2025年10月27日
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]