重定向后,右侧滚动条仅在底部出现时出现

时间:2017-06-13 11:51:13

标签: javascript php css

我是编程新手,但我遇到了一个我从未见过的问题。 我有索引页面和登录按钮。登录后,我重定向到个人资料页面(使用javascript)。 索引和配置文件具有相同的css,但是当我调整浏览器大小时,“配置文件”页面将不会显示右侧的滚动条,除非显示底部的滚动条。如果我退出并转到索引页面,问题就会消失。

重定向的javasciprt:

$.ajax({
            type: 'POST',
            url: 'php_scripts/login_check.php' + '?user=' + user + '&psw=' + psw,
            success: function(data) {
                switch(data) {
                    case '0':
                        window.location.replace('admin.php');
                        break;
                    default:
                        $("#mesaj_psw").html('');
                        $("#mesaj_psw").hide();
                        $("#mesaj_psw").html(data);
                        $("#mesaj_psw").addClass('vizibil nok');
                        $("#mesaj_psw").removeClass('invizibil ok');
                        $("#mesaj_psw").toggle(500);
                        return false;
                }
            }
        });

css:

body, html {
    background-color: #CCC;
    margin: 0;
    font: 1em "Times New Roman", Times, serif;
    cursor: default;
    min-width: 1060px;
    margin: 0 auto;
    height: 100%;
}

.text-no-select{
    /*Dezactivwaza selectare textului*/
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                          supported by Chrome and Opera */
}

.text-select{
    /*Dezactiveaza selectare textului*/
    -webkit-touch-callout: text; /* iOS Safari */
    -webkit-user-select: text; /* Safari */
    -khtml-user-select: text; /* Konqueror HTML */
    -moz-user-select: text; /* Firefox */
    -ms-user-select: text; /* Internet Explorer/Edge */
    user-select: text; /* Non-prefixed version, currently
                          supported by Chrome and Opera */
}
/*
=====================
HEADER
=====================
*/
/*zona header*/
.nav {
    background-color: #222;
    height: 70px;
    color: #fff;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    margin: 0 auto;
    z-index: 1;
}
/*zona meniului care are o latime maxima data*/
.nav-main {
    background-color: #FFF;
    width: 1060px;
    margin: 0 auto;
    /*overflow: visible;*/
}
/*zona logo-ului din meniu*/
.nav-main .logo {
    display: block;
    text-align: center;
    float: left;
    height: 64px;
    padding-top: 3px;
    padding-bottom: 3px;
    padding-left: 15px;
    padding-right: 15px;
    line-height: 32px;
    font-size: 1.4em;
    background-color: #FFF;
    color: #096;
    font-weight: bold;
    width: auto;
    font-family: "Edwardian Script ITC", "Cooper Black", Georgia, Verdana, sans-serif, serif;
}
/*zona meniurilor*/
.nav-main > ul {
    margin: 0;
    padding: 0;
    float: left;
    list-style-type: none;
}
/*lista meniurilor din meniu*/
.nav-main > ul > li {
    float: left;
}
/*meniul propriu-zis din fiecare lista (link-urile aferente fiecarui meniu)*/
.nav-item {
    display: inline-block;
    padding: 15px 20px;
    height: 40px;
    line-height: 40px;
    margin: 0;
    text-decoration: none;
    color: #fff;
    -webkit-transition: background-color 0.3s ease-in 0s;
    -moz-transition: background-color 0.3s ease-in 0s;
    -ms-transition: background-color 0.3s ease-in 0s;
    -o-transition: background-color 0.3s ease-in 0s;
    transition: background-color 0.3s ease-in 0s;
}
/*schimbarea la mouse peste meniu*/
.nav-item:hover {
    background-color: #444;
    cursor: pointer;
}
/*zona din nav, partea dreapta care contine butonul de Log IN*/
/*zona care contine butonul de "Log IN" in nav*/
.user-login {
    float: right;
    margin: 0px;
    padding: 10px 0px;
    height: 40px;
    line-height: 30px;
    display: block;
}
/*butonul de "Sign IN"*/
.btn-sign-up {
    float: left;
    text-decoration: none;
    font-weight: bold;
    background-color: #09F;
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
    margin-right: 15px;
}
/*cand se face hover la butonul de sign in*/
.btn-sign-up:hover {
    background-color: #0CF;
    color: #000;
}
/*butonul de "Log IN"*/
.btn-log-in {
    float: right;
    text-decoration: none;
    font-weight: bold;
    background-color: #090;
    color: #000;
    padding: 10px 20px;
    border-radius: 5px;
}
/*cand se face hover la butonul de log in*/
.btn-log-in:hover {
    background-color: #0F0;
    color: #000;
}
/*zona care contine contul logat in nav*/
.user-logat {
    float: right;
    margin: 0px;
    padding: 5px 0px;
    height: 60px;
    line-height: 30px;
    display: block;
}
/*zona in care e afisat numele utilizatorului*/
.utilizator {
    clear: both;
    display: block;
    color: #CCC;
    font-weight: bold;
    text-align: center;
    /*font-style: oblique;*/
    /*text-transform: uppercase;*/
}
/*zona cu setarile utilizatorului logat*/
.setari {
    clear: both;
    display: block;
}
/*butonul setari al utilizatorului logat*/
.btn-setari {
    float: left;
    text-decoration: none;
    font-weight: bold;
    padding: 0px 15px;
    border-radius: 50px;
    background-color: inherit;
    color: #FFF;
    -webkit-transition: all 0.3s ease-in 0s;
    -moz-transition: all 0.3s ease-in 0s;
    -ms-transition: all 0.3s ease-in 0s;
    -o-transition: all 0.3s ease-in 0s;
    transition: all 0.3s ease-in 0s;
}
.btn-setari:hover {
    background-color: #9494b8;
}
/*butonul logout al utilizatorului logat*/
.btn-logout {
    float: right;
    /*margin-left: 5px;*/
    text-decoration: none;
    font-weight: bold;
    padding: 0px 15px;
    border-radius: 50px;
    background-color: inherit;
    color: #FFF;
    -webkit-transition: all 0.3s ease-in 0s;
    -moz-transition: all 0.3s ease-in 0s;
    -ms-transition: all 0.3s ease-in 0s;
    -o-transition: all 0.3s ease-in 0s;
    transition: all 0.3s ease-in 0s;
}
.btn-logout:hover {
    background-color: #F90;
}
/*
=====================
CONTENT
=====================
*/
/*zona de continut*/
.content-area {
    width: 1060px;
    margin: 0px auto;
    margin-top: 70px;
    margin-bottom: 70px;
}
.continut {
    padding-top: 10px;
    width: 850px;
    float: left;
    color: #282828;
}
.reclame {
    border-left: #CCC 5px double;
    width: 175px;
    float: right;
    padding-top: 10px;
    /*border-radius: 10px;
    border: none;
    border-left: inset 2px #FFF;
    border-right: inset 2px #FFF;*/
}
.reclame-1, .reclame-2, .reclame-3, .reclame-4, .reclame-5 {
    height: 145px;
    margin-bottom: 10px;
    border-radius: 5px;
}

/*
=====================
FOOTER
=====================
*/
/*zona de footer*/
.footer {
    width: 100%;
    position: fixed;
    width: 100%;
    background-color: #222;
    height: 70px;
    color: #fff;
    bottom: 0px;
    left: 0px;
    z-index: 1;
}
/*zona meniului care are o latime maxima data*/
.footer-meniu {
    width: 1060px;
    margin: 0 auto;
}
.footer-meniu > ul {
    list-style-type: none;
    height: 40px;
    padding: 15px 0px;
    line-height: 0px;
    text-align: center;
}
.footer-meniu > ul > li {
    display: inline-block;
    text-decoration: none;
    padding: 0px 30px;
}
.footer-item {
    display: inline-block;
    float: left;
    margin: 0;
    padding: 5px 20px;
    text-decoration: none;
    color: #fff;
    -webkit-transition: background-color 0.3s ease-in 0s;
    -moz-transition: background-color 0.3s ease-in 0s;
    -ms-transition: background-color 0.3s ease-in 0s;
    -o-transition: background-color 0.3s ease-in 0s;
    transition: background-color 0.3s ease-in 0s;
}
/*schimbarea la mouse peste meniu*/
.footer-item:hover {
    cursor: pointer;
    /*background-color: #666;*/
}
.afis_utilizatori {
    clear: both;
    width: auto;
}

/*
=====================
APLICABILE
=====================
*/
.space-content-footer {
    clear: both;
    min-height: 0px;
    min-width: 100%;
}
.opacity-085 {
    opacity: 0.85;
}
.opacity-080 {
    opacity: 0.80;
}
.opacity-075 {
    opacity: 0.75;
}
/*clasa active pentru butoane*/
.active {
    background-color: #444;
    color: #CF9;
}

/*
=====================
FORMURI
=====================
*/
.fereastra {
    border-radius: 5px;
    background-color: $f2f2f2;
}
form {
    border-radius: 5px;
    background-color: #f2f2f2;
    padding: 20px;
}
input[type=text], input[type=password], input[type=number], input[type=email], select {
    width: 100%;
    padding: 6px 10px;
    margin: 5px 0px 15px 0px;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
input[type=radio] {
    padding: 5px 10px;
    margin: 5px 5px 15px 5px;
    width: auto;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
input[type=button], input[type=submit], input[type=reset] {
    border: none;
    color: white;
    padding: 16px 32px;
    text-decoration: none;
    margin: 4px 2px;
    cursor: pointer;
}
.verde {
    background-color: #4CAF50;
    color: white;
}
.verde:hover {
    background-color: #45a049;
}
.rosu {
    background-color: #ff704d;
    color: white;
}
.rosu:hover {
    background-color: #ff3300;
}
.galben {
    background-color: #ffff00;
    color: #45a049;
}.galben:hover {
    background-color: #cccc00;
}
.mesaj {
    width: auto;
    padding: 2px 5px;
    border-radius: 5px;
}
.ok {
    color: #090;
    border: 2px solid #090;
}
.nok {
    color: #F00;
    border: 2px solid #F00;
}
.vizibil {
    display: block;
}
.invizibil {
    display: none;
}
.link_buton {
    text-decoration: none;
    padding: 5px 16px;
    margin: 5px 0px;
    background-color: #000;
    color: #FFF;
    font-weight: bold;
    -o-transition:.3s;
    -ms-transition:.3s;
    -moz-transition:.3s;
    -webkit-transition:.3s;
    /* ...and now for the proper property */
    transition:.5s;
}
.link_buton:hover {
    background-color: transparent;
    color: #90F;
}
/*
=====================
CAND ECRANUL SE MICSOREAZA SUB 1060px pe latime
=====================
*/
@media screen and (max-width: 1060px) {
    .nav {
        width: 1060px;
        position: relative;
    }
    .content-area {
        margin-top: 0px;
        margin-bottom: -15px;
    }
    .footer {
        width: 1060px;
        position: relative
    }
}

个人资料页面:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/template_pacient.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<!-- InstanceBeginEditable name="doctitle" -->
<title></title>
</head>
<body class="text-no-select">
<div class="nav" id="header">
  <div class="nav-main">
    <div class="logo"></div>
    <div class="user-logat">
      <div class="utilizator"></div>
      <div class="setari"></div>
  </div>
</div>
<div class="content-area" id="content"><!-- InstanceBeginEditable name="container" -->
  <div class="continut" id="continut"> CONTINUT </div>
  <?php require_once("php_scripts/afisare_reclame.php"); ?>
  <!-- InstanceEndEditable -->
  <div class="space-content-footer" id="space-content-footer"> </div>
</div>
<div class="footer" id="footer">
  <div class="footer-meniu">
    <?php require_once("php_scripts/afisare_utilizatori.php"); ?>
  </div>
</div>
<script type="text/javascript" src="jQuery/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="java_scripts/index_pacient.js"></script>
<script async type="text/javascript" src="java_scripts/auto_roll_reclame.js"></script>
<script type="text/javascript" src="java_scripts/logout.js"></script>
</body>

你能帮我试试吗? P.S:对不起,如果这是一个我看不到的简单问题......

1 个答案:

答案 0 :(得分:1)

我错过了一个div结束标记。 我真的很抱歉让你浪费你的时间......

<div class="nav" id="header">
  <div class="nav-main">
    <div class="logo"></div>
    <ul>
      <li> <a href="fisa" class="nav-item">Fisa</a> </li>
      <li> <a href="cauta" class="nav-item">Cauta</a> </li>
      <li> <a href="discutii" class="nav-item">Discutii</a> </li>
      <li> <a href="noutati" class="nav-item">Noutati</a> </li>
    </ul>
    <div class="user-logat">
      <div class="utilizator"> Logat: </div>
      <div class="setari">
        <div><a href="setari" class="btn-setari" id="btn_setari">Setari</a></div>
        <div><a href="logout" class="btn-logout" id="btn_logout">Iesire</a></div>
      </div>
    </div>
  </div>
</div>

再次感谢你,并且道歉。