点击事件不起作用 [英] click event is not working
本文介绍了点击事件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
confirm("Want to see the animation");},
function(){
$("button").animate({left:'200px'}).fadeToggle("slow");
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<button>submit</button>
</div>
</form>
</body>
</html>
单击事件将触发仅在我使用警报或确认时".但是,当我开始使用其他功能时,点击事件不会触发.它只是一次又一次地重新加载页面.请提供解决方案...
The click event fires "when i only using alert or confirm". But when i started using another funtion the click event not firing. It just reloading the page again and again. pls give the solution...
推荐答案
(文档).ready(
(document).ready(function(){
( 按钮").click(" );}, 函数(){
("button").click(function(){ confirm("Want to see the animation");}, function(){
(" ).animate({left:' 200px'} ).fadeToggle(" ); }); }); </script> </ 头部 > < body> < form id = " runat = " 服务器"> < div> < button> submit </ button > </ div > </ 表单 > </ 正文 > </ html >
("button").animate({left:'200px'}).fadeToggle("slow"); }); }); </script> </head> <body> <form id="form1" runat="server"> <div> <button>submit</button> </div> </form> </body> </html>
单击事件将触发仅在我使用警报或确认时".但是,当我开始使用其他功能时,点击事件不会触发.它只是一次又一次地重新加载页面.请给出解决方案...
The click event fires "when i only using alert or confirm". But when i started using another funtion the click event not firing. It just reloading the page again and again. pls give the solution...
这篇关于点击事件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文