jquery 之导航鼠标移出隐藏 移入下拉框显示效果

实现 导航鼠标移入出现下拉框 移入下拉框还可以选择标签,移出下拉框再隐藏;

<div class="downbox">
  <h2>热门城市h2>
  <div class="citybox clearfix">
    <span>
      <a href="#" target="_blank">上海a>
    span>
    <span>
      <a href="#" target="_blank">北京a>
    span>
  div>
div>
<ul class="navul clearfix">
	<li class="downli">
		<span>楼盘span>
		<i>i>
	li>
ul>
var aa;
    $('.navul .downli').hover(function () {
      clearTimeout(aa);
      $('.downbox').slideDown(200);
    }, function () {
      aa = setTimeout(function () {
        $('.downbox').slideUp(200);
      }, 100);
    })
    $('.downbox').hover(function () {
      clearTimeout(aa);
      $('.downbox').slideDown(200);
    }, function () {
      aa = setTimeout(function () {
        $('.downbox').slideUp(200);
      }, 100);
    })

你可能感兴趣的:(jQuery,javascript)