Div走到屏幕外

时间:2015-05-15 16:47:24

标签: javascript jquery css twitter-bootstrap

我正在尝试合并这两个脚本:

但是我遇到了问题。在笔记本电脑上一切看起来都很好,但当我调整窗口大小到平板电脑/移动尺寸计数器正在屏幕上方移动。我整天都玩不同的css seeting,但无法弄明白:(

演示: http://brandflow.pl/products/bootstrap/flow%20coming%20soon/video%20+%20round/

我认为它与处理视频的DIV的位置有关...

CSS:

/* GENERAL STYLES
================================================== */
html {
    height:100%
}

body {

    font-family: 'Lato', sans-serif;
    margin:0;
    padding:0;
    height:100%;
    width:100%;
    color: #FFF;
    -webkit-font-smoothing:antialiased;
    -webkit-text-size-adjust:100%
}


p {
    font-size:20px;
    line-height:140%;
    text-align:center
}


ul li {
    display:inline-block;
    list-style:none;
    padding-right: 10px;
}

.wrapper {
    z-index:600;
    position:relative
}

.pattern {
    background-image:url(../images/pattern.png);
    background-repeat: repeat;
    background-attachment:scroll;
    width:100%;
    height:100%;
    position:absolute;
    top:0;
    left:0
}





/* BIG VIDEO BACKGROUND
================================================== */
.big-background {
    z-index:550;
    text-align:center;
    min-height:100%;
    position:relative;
    overflow:hidden
}

.big-background .big-background-container {
    max-width:100%;
    display:inline-block;
    position:absolute;
    top:50%;
    left:50%;
    z-index:0;
    -webkit-transform:translate(-50%,-50%);
    -moz-transform:translate(-50%,-50%);
    -ms-transform:translate(-50%,-50%);
    -o-transform:translate(-50%,-50%);
    transform:translate(-50%,-50%)
}


.big-background-btn:hover {
    color:#fff;
    background:rgba(255,255,255,0.20)
}

.big-background-default-image {
    background:url(../images/sunset.jpg);
    background-repeat:no-repeat;
    background-position:center center;
    background-size:cover;
    width:100%;
    height:100%;
    z-index:0;
    backface-visibility:hidden
}



/* ABOUT SECTION
================================================== */
.about-section {
    font-family:'Lato',sans-serif;
    color:#7f8c8d;
    background:#fff;
    padding:60px 20px
}

.about-section-container {
    text-align:center;
    padding-bottom:50px
}

.about-section-title {
    font-family:'Raleway',sans-serif;
    font-size:40px;
    background:#fff;
    color:#3d566e;
    padding:0 35px;
    margin-bottom:22px;
    background-attachment:scroll;
    background-repeat:repeat-x;
    background-position:center center;
    text-transform:uppercase
}



a.about-section-btn {
    font-family:'Lato',sans-serif;
    font-size:13px;
    text-transform:uppercase;
    text-decoration:none;
    color:#34495e;
    background:transparent;
    border:2px solid #34495e;
    padding:10px 14px;
    cursor:pointer;
    letter-spacing:2px;
    text-align:center;
    display:inline-block;
    -webkit-transition:.4s background ease;
    -moz-transition:.4s background ease;
    -o-transition:.4s background ease;
    transition:.4s background ease;
}

.about-section-btn:hover {
    color:#fff;
    background: #34495e;
}



/* SMALL VIDEO BACKGROUND 
================================================== */
.small-background-section {
    font-family:'Raleway',sans-serif;
    padding:100px 0;
    position:relative;
    width:100%;
    overflow:hidden
}

.small-background-container {
    position:absolute;
    top:50%;
    left:50%;
    text-align:center
}

.small-background-title {
    font-size:40px;
    color:#f1c40f;
    font-weight:300;
    z-index:10;
    display:inline-block;
    text-transform:uppercase;
    margin-bottom:20px;
    margin-top: 20px;
    position:relative;
    background-attachment:scroll;
    background-repeat:repeat-x;
    background-position:top center
}



/* SOCIALS
================================================== */
.socials a {
    color:#fff
}

.socials a:hover {
    color:#bdc3c7
}




/* MEDIA QUERIES
================================================== */

@media screen and (max-width: 768px) {
.about-section-title {
    line-height:1
}
}

@media screen and (max-width: 480px) {
.big-background-title {
    font-size:58px
}

.small-background-title {
    line-height:1
}

/*.player{ display: none;}  -> If you want to remove the video bg on a specific viewport w/o plugin*/
}

@media screen and (max-width: 360px) {
.big-background-title,#colorize {
    line-height:1
}
}

@media screen and (max-width: 320px) {
.small-background-title {
    font-size:30px
}
}

.countdown-container {
    position: relative;
    margin-top: 20%;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    transform: translateY(-50%);

}

.clock-item .inner {
    height: 0px;
    padding-bottom: 100%;
    position: relative; 
    width: 100%;
}

.clock-canvas {
    background-color: rgba(255, 255, 255, .2);
    border-radius: 50%;
    height: 0px;
    padding-bottom: 100%;
}

.text {
    color: #fff;    
    font-size: 30px;
    font-weight: bold;  
    margin-top: -50px;
    position: absolute;
    top: 50%;
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 1);
    width: 100%;
}

.text .val {
    font-size: 50px;
}

.text .type-time {
    font-size: 20px;
}

@media (min-width: 768px) and (max-width: 991px) {
    .clock-item {
        margin-bottom: 30px;        
    }
}

@media (max-width: 767px) {
    .clock-item {
        margin: 0px 30px 30px 30px;
    }
}

HTML:

    https://www.youtube.com/watch?v=iNJdPyoqt8U',containment:'body',autoPlay:true,mute:true,startAt:0,不透明度:1}“>

<div class="pattern"></div> 
    <div class="big-background-container">
        <div class="countdown countdown-container container">
            <div class="row">
                <div class="col-lg-12">
                    <h1>WE'RE COMING SOON</h1>
                    <h3>We are working very hard on the new version of oru site. It will brings a lot of new features. Stay tuned!</h3>
                </div>
            </div>
            <div class="clock row">
                <div class="clock-item clock-days countdown-time-value col-sm-6 col-md-3">
                    <div class="wrap">
                        <div class="inner">
                            <div id="canvas-days" class="clock-canvas"></div>

                            <div class="text">
                                <p class="val">0</p>
                                <p class="type-days type-time">DAYS</p>
                            </div>
                            <!-- /.text -->
                        </div>
                        <!-- /.inner -->
                    </div>
                    <!-- /.wrap -->
                </div>
                <!-- /.clock-item -->

                <div class="clock-item clock-hours countdown-time-value col-sm-6 col-md-3">
                    <div class="wrap">
                        <div class="inner">
                            <div id="canvas-hours" class="clock-canvas"></div>

                            <div class="text">
                                <p class="val">0</p>
                                <p class="type-hours type-time">HOURS</p>
                            </div>
                            <!-- /.text -->
                        </div>
                        <!-- /.inner -->
                    </div>
                    <!-- /.wrap -->
                </div>
                <!-- /.clock-item -->

                <div class="clock-item clock-minutes countdown-time-value col-sm-6 col-md-3">
                    <div class="wrap">
                        <div class="inner">
                            <div id="canvas-minutes" class="clock-canvas"></div>

                            <div class="text">
                                <p class="val">0</p>
                                <p class="type-minutes type-time">MINUTES</p>
                            </div>
                            <!-- /.text -->
                        </div>
                        <!-- /.inner -->
                    </div>
                    <!-- /.wrap -->
                </div>
                <!-- /.clock-item -->

                <div class="clock-item clock-seconds countdown-time-value col-sm-6 col-md-3">
                    <div class="wrap">
                        <div class="inner">
                            <div id="canvas-seconds" class="clock-canvas"></div>

                            <div class="text">
                                <p class="val">0</p>
                                <p class="type-seconds type-time">SECONDS</p>
                            </div>
                            <!-- /.text -->
                        </div>
                        <!-- /.inner -->
                    </div>
                    <!-- /.wrap -->
                </div>
                <!-- /.clock-item -->
            </div>
            <!-- /.clock -->
        </div>
        <!-- /.countdown-wrapper -->
    </div>                                                    

PRINTSCREEN: tablet size mobile size

2 个答案:

答案 0 :(得分:0)

您将要添加媒体查询以针对包含您的计数器的div元素调整移动设备。

it instanceof Array || typeof it == "array"

修复了容器并允许从我的测试中查看它。您可能希望使用相同的媒体查询来调整页脚,因为它似乎也存在一些问题。

答案 1 :(得分:0)

这:.countdown-container有这个:

-webkit-transform: translateY(-50%); -moz-transform: translateY(-50%); transform: translateY(-50%);

一组属性。

页面还有其他问题,但对于特定的事情,您应该设置调整或删除它们。