后退
榜单

B2文章缩略图鼠标滑过图片动画缩放展示

B2文章缩略图鼠标滑过图片动画缩放展示【本站原创】

交互效果说明

当用户将鼠标悬停在文章缩略图区域时,图片会以中心为原点进行1.1倍的平滑放大,同时伴随轻微的阴影抬升效果,形成具有层次感的动态展示。鼠标移出后图片将恢复原始尺寸,整个过程保持0.3秒的缓动动画,确保视觉过渡自然舒适。

效果图展示

B2文章缩略图鼠标滑过图片动画缩放展示

代码部署

把代码里的图片地址替换成你自己的图片链接

以下CSS代码放入子主题b2child/style.css里面

/*B2文章划过动画图片开始*/
 .post-module-thumb:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    background: url(图片地址);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    z-index: 3;
    -webkit-transform: scale(2);
    transform: scale(2);
    transition: opacity .75s, -webkit-transform .75s;
    transition: transform .75s, opacity .75s;
    transition: transform .75s, opacity .75s, -webkit-transform .75s;
    opacity: 0;
    pointer-events: none;
}
.post-module-thumb:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background .35s;
    border-radius: 8px;
    z-index: 2;
    max-width: 765px;
    margin: 0 auto;
    pointer-events: none;
}
 .post-module-thumb:hover:before {
                background: rgba(0,0,0,.5)
            }
        .post-module-thumb:hover:after {
                -webkit-transform: scale(1);
                transform: scale(1);
                opacity: 1
            }
             /*B2文章划过动画图片结束*/

图片样式如下

B2文章缩略图鼠标滑过图片动画缩放展示

给TA打赏
共{{data.count}}人
人已打赏
0 条回复 A文章作者 M管理员
夸夸
夸夸
还有吗!没看够!
    暂无讨论,说说你的看法吧
个人中心
购物清单
优惠代劵
今日签到
有新私信 私信列表
快速搜索
联系客服
关注我们
  • 扫码打开当前页