怎样用jquery做一个弹出的输入框?

我现在想做一个回复功能,点击回复按钮弹出一个可以输入文本的框,而且框里面要可以显示被回复的提问,我用过下面的插件做,可是如果提问太长的话又显示不完,求大神指点
layer.prompt({title: "提问:"+content,type: 3,length:200}, function(reply,index){}

第1个回答  2015-03-19
window.open html代码如下: <input type="button" value="显示" id="b1"/> jquery代码如下: 添加jquery引用。。。 <script type="text/javascript"> $(function(){ $("b1").click("弹出一个窗口页面") }); </...本回答被网友采纳
第2个回答  2016-03-03
只要在弹出层中加上你需要的文本框即可,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>zhezhaoceng.html</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript" src="jquery.js"></script>
<style>
.black_overlay {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.8;
opacity: .80;
filter: alpha(opacity = 80);
}

.white_content {
display: none;
position: absolute;
top: 10%;
left: 10%;
width: 80%;
height: 80%;
border: 16px solid lightblue;
background-color: white;
z-index: 1002;
overflow: auto;
}

.white_content_small {
display: none;
position: absolute;
top: 20%;
left: 30%;
width: 40%;
height: 50%;
border: 16px solid lightblue;
background-color: white;
z-index: 1002;
overflow: auto;
}
</style>
<script type="text/javascript">
//弹出隐藏层
function ShowDiv(show_div,bg_div){
document.getElementById(show_div).style.display='block';
document.getElementById(bg_div).style.display='block' ;
var bgdiv = document.getElementById(bg_div);
bgdiv.style.width = document.body.scrollWidth;
$("#"+bg_div).height($(document).height());
}
//关闭弹出层
function CloseDiv(show_div,bg_div){
document.getElementById(show_div).style.display='none';
document.getElementById(bg_div).style.display='none';
}
</script>
</head>

<body>
<input id="Button1" type="button" value="点击弹出层"
onclick="ShowDiv('MyDiv','fade')" />
<!--弹出层时背景层DIV-->
<div id="fade" class="black_overlay">
</div>
<div id="MyDiv" class="white_content">
<div style="text-align: right; cursor: default; height: 40px;">
<span style="font-size: 16px;" onclick="CloseDiv('MyDiv','fade')">关闭</span>
</div>
目前来说,我还是喜欢这个自己改造的弹出层。自己在项目中也用的是这个。
</div>
<br />
<center>
如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:
<a href='' target='_blank'></a>
</center>
</body>
</html>
jquery的源码就不贴了

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网