加入收藏 | 设为首页 | 会员中心 | 我要投稿 衡阳站长网 (https://www.0734zz.cn/)- 数据集成、设备管理、备份、数据加密、智能搜索!
当前位置: 首页 > 服务器 > 系统 > 正文

DIV点击折叠实例代码

发布时间:2020-03-17 06:15:30 所属栏目:系统 来源:站长网
导读:副标题#e# 废话不多说了,关键代码如下所示: CSS Code复制内容到剪贴板 !doctypehtml html head metacharset=utf-8 metacontent=width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0name=viewport title测试/title styletype=text/cs

                        $(this).parent('.item').addClass('active');                           

                        flag=false;   

                    }else{   

                        $(this).parent('.item').removeClass('active');   

                        flag=true;   

                    }   

                });   

            });   

            $('.menu .item ul li').each(function(){       

                var flag=true;               

                $(this).on('click',function(event){   

                    event.preventDefault();   

                    event.stopPropagation();   

                    if(flag){   

                        $('.menu ul li').removeClass('active');   

                        $(this).addClass('active');   

                        flag=false;   

                    }else{   

                        $(this).removeClass('active');   

                        flag=true;   

                    }                                   

                });   

            });   

        });   

    </script>   

</body>   

</html>  

(编辑:衡阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读