单击按钮后,此代码将写入 div 中。
此表单是使用编写的
document.getElementById('justadiv').innerHTML = $belowFormWithoutWhiteSpaceCharacters
表单比窗口的原始高度高得多。创建表单后,浏览器的滚动条不会显示。有没有办法来解决这个问题。
<div id="background" style="position:fixed;width:100%;height:100%;top:0;left:0;background-color: rgba(0, 0, 0, 0.8)">
<div id="window" style="position:relative;width:350px;top:100px;height:auto;margin-left:auto;margin-right:auto;padding:50px;background-color:white;">
<form name="form1" method="post" action="">
<font>Şirket Adı :</font><br><input name="newname" type="text" maxlength="59">
<br><br>
<font>Şirket Türü :</font><br>
<input type="radio" name="newtype" value="1"><font>Limited</font>
<br>
<input type="radio" name="newtype" value="2"><font>Anonim</font>
<br>
<input type="radio" name="newtype" value="3"><font>Komandit</font>
<br>
<input type="radio" name="newtype" value="4"><font>Kolektif</font>
<br><br>
<font>Logo URL :</font><br>
<input name="newurl" type="url">
<br><br><font>Ticaret Ünvanı :</font><br>
<input name="newticunvan" type="text">
<br><br><font>Ticaret Sicil Numarası :</font><br>
<input name="newticno" type="number">
<br><br><font>Şirketin Bağlı Olduğu Ticaret Sicili Müdürlüğü :</font><br>
<input name="newticmudur" type="text">
<br><br><font>Merkezin Adresi :</font><br>
<input name="newmerkezadres" type="text">
<br><br><font>Telefon Numarası :</font><br>
<input name="newtelno" type="tel">
<br><br><font>Tax Numarası :</font><br>
<input name="newfaxno" type="tel">
<br><br><font>Web sitesi :</font><br>
<input name="newwebadres" type="url">
<br><br><font>E-mail adresi :</font><br>
<input name="newemail" type="email">
<input type="button" value="Pencereyi Kapat" onclick="document.getElementById('formcontainer').innerHTML='' ">
<input type="submit" value="Kaydet">
<input type="hidden" name="newcom">
</form>
</div>
</div>
最佳答案
用户溢出:自动风格
<div id="background" style="position:fixed;width:100%;height:100%;top:0;left:0;background-color: rgba(0, 0, 0, 0.8);overflow:auto"> .... </div>
关于javascript - 新的固定位置 div 创建后滚动条不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22320128/