0

嗨,伙计们,我试图输入我得到的股市行情,但是当我使用marquee它的工作时,我也使用simple scroll并放入了 php usercake 用户管理系统,但它不工作是我的代码有什么问题......

提前致谢..

我使用的代码

<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">

<style type='text/css'>
    .infowrapper {
        width: 100%;
        overflow: hidden;
    }

    #stockinfo {
        width: 800%;
        font-size: 10px;
    }

    .stockWrapper {
        display: block;
        padding-top: 5px;
        font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
        font-weight: 100;
        float: left;
        margin-left: 20px;
        font-size: 12px;
    }

    .stockSymbol {
        font-weight: 100;
    }

    .stockPrice {
        font-weight: 100;
        color: red;
    }

    .stockChange {
        font-weight: 100;
        color: green;
    }

    .stockTime {
        font-weight: 600;
        color: grey;
        font-size: smaller;
        display: hidden;
    }

    h2 {
        font-size: 10px;
    }

    p {
        margin-bottom: 10px;
    }

    .symbol {
        float: left;
        margin-right: 3px;
    }

    .symbol .name {
        display: block
    }

    .symbol.up {
        background: #70DB70
    }

    .symbol.up .change {
        color: green
    }

    .symbol.down {
        background: #f7cdc2
    }

    .symbol.down .change {
        color: red
    }
</style>



<script type='text/javascript'>
    //<![CDATA[
</script>
<script type="text/javascript">
    (function($) {
        $(function() {
            $("#scroller").simplyScroll();
        });
    })(jQuery);
</script>
<script type="text/javascript" src="js/company.js"></script>
<script type="text/javascript" src="js/jquery.simplyscroll.js"></script>
<link rel="stylesheet" href="js/jquery.simplyscroll.css" media="all" type="text/css">

<ul id="scroller" style="background-color:#CCC; height:30px;">
    <li style="height:30px;">
        <div id="stockinfo">
        </div>
    </li>
</ul>
4

2 回答 2

0

简单的答案是不要使用它,如果您想要获得一致呈现的有效文档并且不惹恼读者。

http://www.sitepoint.com/web-foundations/marquee-html-element/

过去曾努力使这部分成为 CSS 3 标准,但即便如此,它们也被放弃了。

本说明替换了与“选框”效果相关的 CSS 功能规范草案。该规范不再被开发。

http://www.w3.org/TR/css3-marquee/

该规范已停产。CSS 工作组没有找到足够的实现,目前没有计划进一步的工作。

于 2015-07-14T17:45:14.850 回答
0

不确定您是否仍然需要对此的答案,但它可能对其他人有所帮助。

不管我们能说什么关于字幕,还有很多人仍在使用它们,所以值得给出一个有用的答案。

标签应该被遗忘;它不受全球支持,因为它是专有的并且从未成为标准(如 Connexo 所写),但您可以使用 css 使您的文本向您想要的任何方向移动。

这是我在 CSS 文件中使用的内容

/************************************************************************/
/* Marquee with text moving from right to left                          */
/************************************************************************/
/* Make it a MarqueeTxt */
.MarqueeTxt {
    width: 900px; /* What I call the see-through window below */
    margin: 0 auto;
    overflow: hidden;
    white-space: nowrap;
    font-size:2.5em;

    color:#CD3245;
    text-shadow: #000 1px 1px 0;
    box-sizing: border-box;

    /* This is to make the text move across the see-through window */
    /* in 20 seconds (=> scrolling speed) */
    animation: MarqueeTxt 20s linear infinite;
    -webkit-animation: MarqueeTxt 20s linear infinite;

    /* This is for Safari that tends to render jerky marquees */
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);

}

/* This is to stop scrolling when hovering over the text */
.MarqueeTxt:hover {
    animation-play-state: paused;
    -webkit-animation-play-state: paused
}

/* Make it move */
/* If omitted, IE will not scroll the text  */
@keyframes MarqueeTxt {
    0% { text-indent: 26em }
    100% { text-indent: -55em }

}

/* Make it move */
/* If omitted, Chrome (possibly FF) will not scroll the text  */
@-webkit-keyframes MarqueeTxt {
    0% { text-indent: 26em }
    100% { text-indent: -55em }

}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

在 PHP 或 HTML 中,您通常在这样的<p>标签 中使用它<p class="MarqueeTxt">The text you want to display</p>

您将不得不使用width: 900px;text-indent: 26em并且text-indent: -55em如果您想确保您的文本从右到左正确滚动并在几秒钟后重新出现,一旦它完全滚动。

我已经在 IE、Safari、Chrome 和 FF 上对此进行了测试。

我希望这个能帮上忙

于 2017-11-08T19:33:05.747 回答