小米下拉框jQuery实现
2024-08-30 13:29:03
<div class="daohanglan">
<div class="dh">小米手机 <--多个自己定义-->
<div class="dhbottom">
</div>
</div>
</div>
<--要给最外面的div设置padding值为了区分开从外部移入和横向移动-->
$(document).ready(function(){
let tag=0;
$(".daohanglan").mouseenter(function(){ <!--.daohanglan为导航栏所在的块,.dh为显示的导航标题,.dhbottom为移入所要显示出来的列表-->
tag=3;
console.log("daohanglan移入");
});
$('.dh').hover(function(){
$(this).mouseenter(function(){
tag=1;
console.log("dh移入");
});
if(tag===1)
{ $(this).children('.dhbottom').css({height:230}).css({display:"block"}).show(); }
if(tag===3){
$(this).children('.dhbottom').animate({height:230},500).show(); }
},function(){
$(this).children('.dhbottom').animate({height: 0}, 500).hide(); }); });
最新文章
- C# 泛型
- Hadoop学习笔记—4.初识MapReduce
- 关于sql 的列转行
- HTTP状态代码含义
- AutoResetEvent waitone set进一步理解补充
- 自动化中的PageObject思想
- 配置OpenStack以使用LDAP实现身份管理
- js难点之闭包理解
- RocketMq消息队列使用
- Memo打印
- (转)ThinkPHP3.0 使用分组后路径访问无效的解决方法!
- 循环结构中break、continue、return和exit的区别
- jenkins IOS- ad-hoc 打包
- h5video标签
- 《java入门第一季》之面向对象(继承)
- springboot2 redis
- Hadoop2.7.6_04_HDFS的Shell操作与常见问题
- boke练习: springboot整合springSecurity出现的问题,传递csrf
- centos7下apache2.4反向代理
- 20155313 杨瀚 《网络对抗技术》实验八 Web基础