jq问题处理
1、同一个事件,点击显示和隐藏 $(document).ready(function(){ $('.container .nav-header').click(function(){ var change = $('.container .change-link') $('.container .menu').slideToggle(100); if(change.is(':hidden')) { $(change).show(); }else{ $(change).hide(); } }) }); 2、同一个事件,点击显示和隐藏 $(document).ready(function(){ var winWidth = $(window).width(); if(winWidth<641){ var userDown = $('nav.top-nav .menu'); var change = $('nav.top-nav .change-link'); userDown.hide(); change.hide(); $('nav.top-nav').click(function(){ userDown.toggle(); change.toggle(); /* if(userDown.is(':visible')) { change.show(); }*/ }); } }); 3、jq布局左侧等于右侧高度 $(function() { var _leftheight = $(".focuside").height(); var _rightheight = $(".g-side2").height(); if(_leftheight > _rightheight ) { $(".g-side2").height(_leftheight); } else { $(".focuside").height(_rightheight); } }) 3、点击事件开启关闭 <script> $(function(){ var winWidth = $(window).width(); if(winWidth<641) { $('#user .nav-list').fadeOut(); $('#user .nav-action').click(function(){ $('#user .nav-list').toggle(100); }); } }) </script>
全部教程http://each.sinaapp.com/angular/index.html