Home > Backend Development > PHP Tutorial > 关于jq显示隐藏的成效

关于jq显示隐藏的成效

WBOY
Release: 2016-06-13 12:02:50
Original
1029 people have browsed it

关于jq显示隐藏的效果

按钮
内容



$('#mune_1').hover(function(){
$('.second_mune').show();
},function(){
$('.second_mune').hide();
})


我修改成这样,因为鼠标经过的a标签和要显示内容的span不在同一个div上,所以我鼠标指向a标签显示内容后,再移到span标签上还是会隐藏掉,怎样修改才能让鼠标移到a标签和span标签都能显示内容??
------解决方案--------------------
感觉加个容器比较好

<span><br />    <a class="mune_1">按钮</a><br />    <span class="second_mune" style="display:none">内容</span><br /></span><br />
Copy after login
    $('.mune_1').hover(function(){<br />      $(this).parent().hover(function(){<br />        $('.second_mune').show();<br />      },function(){<br />        $('.second_mune').hide();<br />      })<br />    })   <br />
Copy after login

------解决方案--------------------
不知道!
我只能满足你已提出的要求
无法预测你还会做什么

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template