HTML+JS鼠标触及图片向上滚动效果

编程入门 行业动态 更新时间:2024-10-21 09:32:25

HTML+JS<a href=https://www.elefans.com/category/jswz/34/1769042.html style=鼠标触及图片向上滚动效果"/>

HTML+JS鼠标触及图片向上滚动效果

效果演示

代码

<!DOCTYPE html>
<html>
<head><title>鼠标移到到图片,图片向上滑动预览效果</title><script src=".2.4/jquery.min.js"></script><script type="text/javascript">//图片滚动$(document).ready(function(){function template($this,img_h,info_h){function img1_sin(){$this.find(".img1").find("img").stop(true,true).animate({top: -(img_h-info_h)},(img_h-info_h)*4,"linear")}img1_sin();}$(".slide").mouseover(function(){var info_h = $(this).find(".img1").find(".info").height();var img_h = $(this).find(".img1").find("img").height();template($(this),img_h,info_h);})$(".slide").mouseout(function(){$(this).find(".img1").find("img").stop(true,true).animate({top: 0}, 800 , "linear");})})</script><style type="text/css">.img1{width: 305px;height: 206px;padding: 12px 1px 1px;-webkit-transition: all .3s;transition: all .3s;position: relative;}.info{    overflow: hidden;height: 100%;position: relative;}.slide img{max-height: inherit;*max-height: none;position: absolute;top: 0;}</style>
</head>
<body><div class="slide" style="width:330px;"><div class="img1" style="margin-left:15px;"><div class="info"><a href="" target="_blank"><img src=".jpg" width="305" alt=""></a></div></div></div>
</body>
</html>

更多推荐

HTML+JS鼠标触及图片向上滚动效果

本文发布于:2024-02-27 06:54:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1705596.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鼠标   效果   图片   HTML   JS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!