简体   繁体   English

使用flowtype.js很难使我的文本更具响应性

[英]Having a hard time using flowtype.js to make my text more responsive

I've been trying to make the text in my wesbite more responsive and I've been trying to use flowtype.js seen here: http://simplefocus.com/flowtype/ to accomplish this. 我一直在尝试使wesbite中的文本更具响应性,并且一直在尝试使用在此处看到的flowtype.js: http ://simplefocus.com/flowtype/来完成此操作。 However no matter what I do it doesn't seem to be working. 但是,无论我做什么,似乎都没有用。 The text does not resize itself when the viewport is changed I've included my code and a jfiddle down below. 更改视口时,文本不会自动调整大小,我在下面包括了代码和jfiddle。 Any help will be greatly appreciated! 任何帮助将不胜感激!

Jfiddle: http://jsfiddle.net/4jy1dvxx/ Jfiddle: http : //jsfiddle.net/4jy1dvxx/

Html: HTML:

                    <div id="whoText">

                        <p class="header">Who we are</p>

                        <p class="boxText">
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </p>

                        <p class="boxText">
        Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Lati</p>

                    </div>

CSS: CSS:

#whoText {
    width:45%;
    float:left;
    height:500px;
}

#whatText {
    width:45%;
    float:right;
    height:500px;
}

#whiteBox {
    width:30%;
    float:right;
    height:500px;
}

#textContain {
    width:60%;
    display: inline-block;
    vertical-align: middle;
}

.header {
    font-family: 'Dosis', sans-serif;
    font-size:1.875em;
    font-weight:800;   
    text-align:left;
    color:#000;
    padding-bottom:20px;
}

.boxText {
    font-family: 'Josefin Slab', serif;
    font-weight: 600;
    font-size:1.063em;
    color:#000;
    text-align:left;
    line-height:23px;
    padding-bottom:15px;
}

JS: JS:

        $(document).ready(function() {
            $('whoText').flowtype({
                minimum   : 500,
                maximum   : 1200
            });
        })

Your missing the hashtag used for targeting the ID whoText. 您缺少用于定位ID WhoText的井号。

$(document).ready(function() {
        $('#whoText').flowtype({
            minimum   : 500,
            maximum   : 1200
        });
    })

Try setting the selector to body instead of whoText , eg: 尝试将选择器设置为body而不是whoText ,例如:

$(document).ready(function() {
    $('body').flowtype({
            minimum   : 500,
            maximum   : 1200});
 })

JsFiddle 的jsfiddle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM