js模仿hover的具体实现代码
作者:互联网
2025-08-17
复制代码代码如下:
< !DOCTYPE HTML >
< html >
< head >
< meta charset="utf-8" >
< meta name="description" content="this" / >
< meta name="keywords" content="this" / >
< title >this< /title >
< script type="text/javascript" src="http://ajax.*g*oog*leapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" >< /script >
< style type="text/css" >
body{margin:0;padding:0;}
.hover{float:left;position:relative;margin:0 auto;padding:0; }
.hv{position:absolute; left:0;top:0;display:none; }
< /style >
< script type="text/javascript" >
$(function() {
$('.hover').hover(
function (){
$('.hv').stop().fadeTo('slow',1);
},function() {
$('.hv').stop().fadeTo('slow',0);
}
)
})
< /script >
< /head >
< body >
< div >
< img src="http://img.*vip.xun**lei.com/img/banner/201303181424386268.jpg" width='100px' height='100px' >
< img src="http://www.ba***idu.com/img/shouye_b5486898c692066bd2cbaeda86d74448.gif" width='100px' height='100px' >
< /div >
< /body >
< /html >
相关标签:
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
「性能优化」虚拟列表极致优化实战:从原理到源码,打造丝滑滚动体验
你的 Vue 3 生命周期,VuReact 会编译成什么样的 React?
你的 Vue 3 defineProps(),VuReact 会编译成什么样的 React?
Vue条件渲染详解:v-if、v-show用法与实战指南
前端性能内卷终点?Signals 正在重塑我们的开发习惯
使用 IntersectionObserver + 哨兵元素实现长列表懒加载
大屏卡成 PPT?这 3 个性能优化招数亲测有效
别再用 JSON.parse 深拷贝了,聊聊 StructuredClone
当 Vue 3 遇上桥接模式:手把手教你优雅剥离虚拟滚动的业务大泥球
VueUse 全面指南|Vue3组合式工具集实战
AI精选
