dpndp64206 2018-09-03 17:16
浏览 50

Bootstrap Html Php

I have a navigation toggle it appears when screen is small after i included 1 php file which which is bootstrap modal, after including that my navigation toggle is not closing after opening.Im unable to close the navigation menu. I have include both the files index as well as request which is data modal file

 <?php require 'request.php';?>
<header class="navigation navbar navbar-fixed-top">
   <div class="container">
      <div class="navbar-header">
         <!-- responsive nav button -->
         <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
         <span class="sr-only">Toggle navigation</span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         </button>
         <!-- /responsive nav button -->
         <!-- logo -->
         <a class="navbar-brand logo" href="index.html">
         <img class="logo-white" src="images/logo1.png" alt="logo"  style="width:40px;float:left;"/>
            <p class="logo-white" style="float:right;font-size:  30px;color:  white;font-family:  initial;margin-top:5px;margin-left:8px;">Expert Web Solutions</p>
             <img class="logo-default" src="images/logo2.png" alt="logo"  style="width:40px;float:left;"/>
            <p class="logo-default" style="float:right;font-size:  30px;color:  #000;font-family:  initial;margin-top:5px;margin-left:8px;">Expert Web Solutions</p>
         </a>
         <!-- /logo -->
      </div>
      <!-- main nav -->
      <nav class="collapse navbar-collapse navbar-right">
         <ul id="nav" class="nav navbar-nav menu">
               <li>
                  <a href="index.html" >Home </span></a>

               </li>
               <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Services <span class="caret"></span></a>
                  <ul class="dropdown-menu">
                     <li><a href="mobile.html">Mobile App Development</a></li>
                  <li><a href="webdevelopment.html">Web Development</a></li>
                  <li><a href="softdevelopment.html">Software Development</a></li>
               <li><a href="softconsultancy.html">Software Consultancy</a></li>
                <li><a href="softtesting.html">Software Testing and<br> Quality Assurance</a></li>
                  </ul>
               </li>
               <li><a href="technologies.html">Technologies</a></li>
               <li><a href="about.html">About Us</a></li>
               <li><a href="careers.html">Careers</a></li> 
               <li><button type="button"  data-toggle="modal" data-target="#myModal">Request A Quote</button></li> 
               <li><a href="contact.html">Contact Us</a></li>


            </li>
         </ul>
      </nav>

      <!-- /main nav -->
   </div>
</header>



<this is request.php>
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>


        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <link rel="stylesheet" href="form.css" >
        <script src="form.js"></script>
  </head>
<body>

<div class="container">

  <!-- Trigger the modal with a button -->


  <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">

      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4 class="modal-title">Request A Quote</h4>
        </div>
        <div class="panel-body">
                                <form id="reused_form">
                                    <div class="form-group">

                                        <input type="text" name="name" required class="form-control" placeholder="Enter Name">
                                    </div>
                                    <div class="form-group">

                                        <input type="email" name="email" required class="form-control" placeholder="Enter Email">
                                    </div>
                                    <div class="form-group">

                                        <input name="phone" class="form-control" placeholder="Enter Phone Number">
                                    </div>
                                    <div class="form-group">

                                        <textarea rows="3" name="message" class="form-control" placeholder="Write Your Requirements"></textarea>
                                    </div>

                                    <div class="form-group">
                                        <button class="btn btn-raised btn-lg btn-warning" type="submit" style="
    border: none;
    padding: 15px 0;
    width: 100%;
    margin: 0;
    background: #2b315d;
    color: #fff;
    border-radius: 0;
">Send</button>
                                    </div>
                                </form>
                                <div id="error_message" style="width:100%; height:100%; display:none; ">
                                    <h4>
                                        Error
                                    </h4>
                                    Sorry there was an error sending your form. 
                                </div>
                                <div id="success_message" style="width:100%; height:100%; display:none; ">
<h2 style="color:#000; font-size:22px;text-align:center;">Thank You! <br>Your Message was Sent Successfully.<br>One of our representatives will contact you shortly.</h2>

</div>
                            </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>

    </div>
  </div>

</div>

</body>
</html>
  • 写回答

1条回答 默认 最新

  • dongyan9838 2018-09-04 19:52
    关注

    I think require.php breaks the html including head section again and opening and closing html and body tags.

    Maybe this will work ?

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <title>Bootstrap Example</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    
    
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <link rel="stylesheet" href="form.css" >
        <script src="form.js"></script>
    </head>
    <body>
    <header class="navigation navbar navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <!-- responsive nav button -->
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <!-- /responsive nav button -->
                <!-- logo -->
                <a class="navbar-brand logo" href="index.html">
                    <img class="logo-white" src="images/logo1.png" alt="logo"  style="width:40px;float:left;"/>
                    <p class="logo-white" style="float:right;font-size:  30px;color:  white;font-family:  initial;margin-top:5px;margin-left:8px;">Expert Web Solutions</p>
                    <img class="logo-default" src="images/logo2.png" alt="logo"  style="width:40px;float:left;"/>
                    <p class="logo-default" style="float:right;font-size:  30px;color:  #000;font-family:  initial;margin-top:5px;margin-left:8px;">Expert Web Solutions</p>
                </a>
                <!-- /logo -->
            </div>
            <!-- main nav -->
            <nav class="collapse navbar-collapse navbar-right">
                <ul id="nav" class="nav navbar-nav menu">
                    <li>
                        <a href="index.html" >Home </span></a>
    
                    </li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Services <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="mobile.html">Mobile App Development</a></li>
                            <li><a href="webdevelopment.html">Web Development</a></li>
                            <li><a href="softdevelopment.html">Software Development</a></li>
                            <li><a href="softconsultancy.html">Software Consultancy</a></li>
                            <li><a href="softtesting.html">Software Testing and<br> Quality Assurance</a></li>
                        </ul>
                    </li>
                    <li><a href="technologies.html">Technologies</a></li>
                    <li><a href="about.html">About Us</a></li>
                    <li><a href="careers.html">Careers</a></li>
                    <li><button type="button"  data-toggle="modal" data-target="#myModal">Request A Quote</button></li>
                    <li><a href="contact.html">Contact Us</a></li>
    
    
                    </li>
                </ul>
            </nav>
    
            <!-- /main nav -->
        </div>
    </header>
    <?php require 'request.php';?>
    </body>
    </html>
    

    below request PHP

            <!-- Trigger the modal with a button -->
    
    
            <!-- Modal -->
            <div class="modal fade" id="myModal" role="dialog">
                <div class="modal-dialog">
    
                    <!-- Modal content-->
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal">&times;</button>
                            <h4 class="modal-title">Request A Quote</h4>
                        </div>
                        <div class="panel-body">
                            <form id="reused_form">
                                <div class="form-group">
    
                                    <input type="text" name="name" required class="form-control" placeholder="Enter Name">
                                </div>
                                <div class="form-group">
    
                                    <input type="email" name="email" required class="form-control" placeholder="Enter Email">
                                </div>
                                <div class="form-group">
    
                                    <input name="phone" class="form-control" placeholder="Enter Phone Number">
                                </div>
                                <div class="form-group">
    
                                    <textarea rows="3" name="message" class="form-control" placeholder="Write Your Requirements"></textarea>
                                </div>
    
                                <div class="form-group">
                                    <button class="btn btn-raised btn-lg btn-warning" type="submit" style="
        border: none;
        padding: 15px 0;
        width: 100%;
        margin: 0;
        background: #2b315d;
        color: #fff;
        border-radius: 0;
    ">Send</button>
                                </div>
                            </form>
                            <div id="error_message" style="width:100%; height:100%; display:none; ">
                                <h4>
                                    Error
                                </h4>
                                Sorry there was an error sending your form.
                            </div>
                            <div id="success_message" style="width:100%; height:100%; display:none; ">
                                <h2 style="color:#000; font-size:22px;text-align:center;">Thank You! <br>Your Message was Sent Successfully.<br>One of our representatives will contact you shortly.</h2>
    
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        </div>
                    </div>
    
                </div>
            </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?