HTML中的动态内容不会滚动

时间:2015-11-26 21:41:46

标签: php html scroll overflow

我有一个HTML页面和很多PHP内容(菜单,产品包装盒等)。我的问题是整个内容不滚动。屏幕就像冻结一样。

我有:

html {
    overflow-y: scroll;
}

我的代码中没有隐藏的溢出。另外,我没有固定的定位。 一开始,滚动条甚至没有出现。然后我想制作技巧并添加

body {
   overflow-y: scroll;
   height:1000px;
}

滚动条出现了。它在滚动时移动,但页面仍然没有滚动。

您对我如何解决这个问题有什么建议吗?谢谢!



.sm-userdata td{
	padding: 10px 20px 10px 0px;
}

.thumbnail:hover {
	border-color: #0088cc;
  -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
     -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
          box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25);
}

#image{
	
  padding: 4px;
  
  border: 1px solid #ddd;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
     -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055);
  
}
html {
    overflow-y: scroll;
}
body {
    overflow-y: scroll;
}
#content {
    height: 1000px;
    overflow-y: scroll;
}

<?php
session_start();
include 'config.php';
?>
<!DOCTYPE html>
<html style="overflow-y: scroll">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 

        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" />
        <link rel="stylesheet" href="./css/theme.css" type="text/css" />
        <link rel="stylesheet" type="text/css" media="screen" href="<?php echo($thestyle);?>.css" >
        
        <!--zmiana kolorow-->
        <!--link href="main.css" rel="stylesheet" type="text/css" />
        <link id="currentCSS" href="defaultColors.css" rel="stylesheet" type="text/css" /!-->

        <script src="./js/jquery.js" type="text/javascript"></script>  
        <script src="./js/bootstrap.min.js" type="text/javascript"></script> 
        <script src="./js/jquery-ui.js" type="text/javascript"></script>

        <!--[if lt IE 9]>
          <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
          <script type="text/javascript">
          (function(){
            var html5elements = "address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|progress|ruby|section|time|video".split('|');
            for(var i = 0; i < html5elements.length; i++){
              document.createElement(html5elements[i]);
            }
    
          })();
          </script>
        <![endif]-->

        <title>Sklep</title>

    </head>
            <body>

        <div id="content">
        
        <?php
        require './application/classes/Database.php';
        $database = new Database($db_server, $db_user, $db_password, $database_name);

        include './application/partials/topmenu.php';

        if (!isset($_GET['user'])) {

            if (!isset($_GET['action']) || ($_GET['action'] != 'register' && $_GET['action'] != 'remindpassword' && $_GET['action'] != 'contact' && $_GET['action'] != 'cart' && $_GET['action'] != 'order')) {
                ?>
                <div class="container">


                    <div class="row">
                        <div class="col-md-3">
                            <form action="./index.php" method="get">
                                <input type="hidden" name="action" value="searchresult"/>
                                <div class="input-group" style="margin-bottom: 20px;">
                                    <input type="text" name="search" id="search_query" class="form-control">
                                    <div class="input-group-btn">
                                    <button class="btn" type="submit">Szukaj</button>
                                    </div>
                                </div>
                            </form>
        <?php
        include './application/partials/menu.php';
        ?>
                        </div>
                        <div class="col-md-9">

        <?php
    }

    if (!isset($_GET['action'])) {
        include './application/scripts/home.php';
    } elseif ($_GET['action'] == 'register') {
        include './application/scripts/register.php';
    } elseif ($_GET['action'] == 'contact') {
        include './application/scripts/contact.php';
    } elseif ($_GET['action'] == 'remindpassword') {
        include './application/scripts/remindpassword.php';
    } elseif ($_GET['action'] == 'showcategory') {
        include './application/scripts/showcategory.php';
    } elseif ($_GET['action'] == 'searchresult') {
        include './application/scripts/searchresult.php';
    } elseif ($_GET['action'] == 'showproduct') {
        include './application/scripts/showproduct.php';
    } elseif ($_GET['action'] == 'cart') {
        include './application/scripts/cart.php';
    } elseif ($_GET['action'] == 'order') {
        include './application/scripts/order.php';
    }

    if (!isset($_GET['action']) || ($_GET['action'] != 'register' && $_GET['action'] != 'remindpassword' && $_GET['action'] != 'contact' && $_GET['action'] != 'cart' && $_GET['action'] != 'order')) {
        ?>
                        </div>                
                    </div>

                </div>
        <?php
    }
} else {

    require './application/partials/auth.php';

    if ($_GET['action'] == 'editaccount') {
        include './application/scripts/editaccount.php';
    } elseif ($_GET['action'] == 'account') {
        include './application/scripts/account.php';
    } elseif ($_GET['action'] == 'orderdetails') {
        include './application/scripts/orderdetails.php';
    }
}
?> 


<!--select>
  <option value="style1" href="index.php?set=style1">pierwszy</option>
  <option value="style2" href="index.php?set=style2">drugi</option>
</select!-->
                

            </div>
                
    </body>
</html>
&#13;
&#13;
&#13;

这只是index.php和theme.css文件。

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。谢谢大家的任何建议(关于格式化我的帖子,我的语言和其他无用的浪费时间的东西@Dagon和@ Fred-ii-)

在这里回答:http://davidlains.com/strange-twitter-bootstrap-scrolling-issue