javascript - 新的固定位置 div 创建后滚动条不显示

标签 javascript html forms scrollbar innerhtml

单击按钮后,此代码将写入 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/

相关文章:

javascript 定义参数

javascript - 追加到倒数第二个元素

javascript - 两个内联 block div 的垂直对齐

php - 如何以在 php 中作为字符串回显的形式填充单选按钮?

javascript - 如何自动填写此密码,网络表单弹出?

javascript - 解码 Javascript For 循环

jquery - 将一些 jQuery 添加到文本区域以调整它的高度

javascript - 用户滚动到页面底部超时后添加类

PHP - 上传多个文件

javascript - 选中的菜单使用 js 突出显示 Razor 3 cshtml