隐藏按钮在jquery中无法正常工作 [英] hide button not working properly in jquery

查看:58
本文介绍了隐藏按钮在jquery中无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>

<script  type="text/javascript">
    $(document).ready(function () {
        $("#hide").click(function () {
            $("p").hide();
        });
        $("#show").click(function () {
            $("p").show();
        });
    });
</script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    <p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
<button id="show">Show</button>
    </div>
    </form>
</body>
</html>





。隐藏数据但是它立即显示数据。隐藏按钮它应该只隐藏数据



当我双击然后它只隐藏。单击它不......因为我使用了点击功能而不是dblclick ....那么为什么它显示这样。

帮助!!



请告诉我错过了

谢谢




in output when i click on hide button .it hides data but instantly it shows me data back too.on hide button it should only hide data

when i double click then only it hides .on single click it doesn't......as i have used click function not dblclick....then why is it showing like this.
help!!

pls tell wat i missed
thanks

推荐答案

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


(#hide)。click(function) (){
("#hide").click(function () {


(p)。hide();
});
("p").hide(); });


这篇关于隐藏按钮在jquery中无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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