Javascript-Jquery/textbox,提交
这是。Javascript-Jquery/textbox,提交,javascript,jquery,html,Javascript,Jquery,Html,这是。 一切正常,因此,如果我在文本框外单击,它将返回默认大小,但如果单击“提交”按钮,它也将返回正常大小,并且不会提交数据。有人能帮我解决这个问题吗?你必须注释掉这一行: $("#sbutton_block").slideUp("fast"); 在action属性中,您必须为Post变量编写一个php页面名 这是你修改过的代码 希望有帮助。首先,您的代码不起作用,因为在单击“事件开启”按钮之前,“开启模糊”功能将启动 所以我换成这个 HTML <form method="post" a
一切正常,因此,如果我在文本框外单击,它将返回默认大小,但如果单击“提交”按钮,它也将返回正常大小,并且不会提交数据。有人能帮我解决这个问题吗?你必须注释掉这一行:
$("#sbutton_block").slideUp("fast");
在action属性中,您必须为Post变量编写一个php页面名
这是你修改过的代码
希望有帮助。首先,您的代码不起作用,因为在单击“事件开启”按钮之前,“开启模糊”功能将启动 所以我换成这个
HTML
<form method="post" action="" onsubmit="return false;">
<div id="vsetko">
<textarea id="scontent"></textarea>
<div id="sbutton_block" style="display:none;">
<input type="submit" id="sbutton" value=" Share " />
</div>
</div>
</form>
JQUERY
$(document).ready(function(){
$("#scontent").focus(function(){
$(this).animate({"height": "85px",}, "fast" );
$("#sbutton_block").slideDown("fast");
return false;
});
$("html").click(function(event){
if ($(event.target).attr("id") != "scontent") {
$("#scontent").animate({"height": "30px",}, "fast" );
$("#sbutton_block").slideUp("fast");
return false;
}
});
$("#scontent").keypress(function(){
var MaxLen = 250;
return ($(this).val().length <= MaxLen);
});
$("#sbutton").click(function(){
// do your stuff
return false;
});
});
$(文档).ready(函数(){
$(“#scontent”).focus(函数(){
$(this.animate({“height”:“85px”,},“fast”);
$(“按钮块”)。向下滑动(“快速”);
返回false;
});
$(“html”)。单击(函数(事件){
if($(event.target).attr(“id”)!=“scocontent”){
$(“#scontent”).animate({“height”:“30px”,“fast”);
$(“#按钮块”).slideUp(“快速”);
返回false;
}
});
$(“#scontent”).keypress(函数(){
var MaxLen=250;
return($(this).val().length感谢您的回答!由于某种原因,如果我在网站上的任何位置单击,而不是仅在文本区域内单击,文本框的大小将发生变化。释放鼠标按钮后,提交按钮dissaparing.answer已更新,请在此联机检查嗨!此代码禁用了页面上的所有链接:$(“html”)。单击(函数(event){if($(event.target).attr(“id”)!=“scocontent”){$(“#scocontent”).animate({“height”:“30px”,},“fast”);$(“#sbutton_block”)。slideUp(“fast”);return false;});我如何解决这个问题?签出这个;)现在提交按钮不起作用了:谢谢你的快速回答。有些原因是它没有正常工作。
$(document).ready(function(){
$("#scontent").focus(function(){
$(this).animate({"height": "85px",}, "fast" );
$("#sbutton_block").slideDown("fast");
return false;
});
$("html").click(function(event){
if ($(event.target).attr("id") != "scontent") {
$("#scontent").animate({"height": "30px",}, "fast" );
$("#sbutton_block").slideUp("fast");
return false;
}
});
$("#scontent").keypress(function(){
var MaxLen = 250;
return ($(this).val().length <= MaxLen);
});
$("#sbutton").click(function(){
// do your stuff
return false;
});
});