求解!!mouseover在jQuery中触发失效,是我写错了还是jQuery导入错误还是浏览器问题还是相关官方已经关闭不给使用了?代码检查过了,之前可以的,逐磨了好久没明白
4条回答 默认 最新
- Xiao_冬 2022-06-22 00:46关注
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style> #thread2, #thread4 { width: 300px; height: 300px; background-color: red; position: absolute; } </style> </head> <body> <ul style="list-style-type: none"> <ol> <div class="css1"> <div class="css2"><a id="thread1" href="">新闻</a></div> <div class="css3"><a id="thread3" href="">娱乐</a></div> </div> </ol> <ol> <div id="thread2"></div> <div id="thread4"></div> </ol> </ul> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> $(document).ready(function () { $("#thread1").mouseover(function () { $("#thread2").css("background-color", "green").css("z-index", "10"); }); $("#thread1").mouseout(function () { $("#thread2").css("background-color", "red").css("z-index", "0"); }); }); </script> </body> </html>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 1无用 1
悬赏问题
- ¥15 如何在scanpy上做差异基因和通路富集?
- ¥20 关于#硬件工程#的问题,请各位专家解答!
- ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
- ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
- ¥30 截图中的mathematics程序转换成matlab
- ¥15 动力学代码报错,维度不匹配
- ¥15 Power query添加列问题
- ¥50 Kubernetes&Fission&Eleasticsearch
- ¥15 報錯:Person is not mapped,如何解決?
- ¥15 c++头文件不能识别CDialog