如何解决这个问题(jQuery) [英] how to resolve This Problem(Jquery)

查看:123
本文介绍了如何解决这个问题(jQuery)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style>
</style>

<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
      $(document).ready(function () {
      $('.t2').hide();
      $('.t1').mouseenter(function(){  $('.t2').show(1000);});
      $('.t1').mouseleave(function(){  $('.t2').hide(1000);});
                                    });
        </script>
</head>
<body>
<div class="t1" style="background-color:red;">
1
<div class="t2" style="background-color:blue;">
2
</div>
</div>

</body>
</html>





如果鼠标多次以类t1快速进入和退出div
然后Jquery保存此状态,并在鼠标状态离开但Div类t2正在运行并显示和隐藏多次的情况下





if mouse many times enter and exit from div with class t1 fast
then Jquery Save this States and when mouse State Is Leave But Div Class t2 is runing and show and hide many times
how to resolve????

推荐答案

(document).ready(function(){
(document).ready(function () {


('.t2' ).hide();
('.t2').hide();


('.t1').mouseenter(function(){
('.t1').mouseenter(function(){


这篇关于如何解决这个问题(jQuery)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆