zoukankan      html  css  js  c++  java
  • 文字的向上滚动

    .gundong{
                    height: 50px;
                    overflow: hidden;
                }
                .gundong ul{
                    list-style: none;
                     100%;
                    display: block;
                    height: 50px;
                }
                .gundong ul li{
                    height: 50px;
                    background: bisque;
                    line-height: 50px;
                }

    <div class="gundong">
                <ul>
                    <li>dfh</li>
                    <li>dfhdif</li>
                    <li>feuif</li>
                    <li>fhur</li>
                    <li>fhuerfye</li>
                    <li>ewrope</li>
                    <li>pdfo</li>
                </ul>
            </div>

    setInterval(function(){
                    if(!$('.gundong ul').is(':animated')){
                        var hei =$('.gundong ul li').height();
                        var len = $('.gundong ul li').length;
                        var heilen = hei*len;
                        var whei = hei;
                        var mar1= parseInt($('.gundong ul').css('margin-top'));
                        var endmar = (parseInt((heilen/whei)-1)*whei);
                        if(mar1<=-endmar){
                            $('.gundong ul').animate({marginTop:'0px'},300)
                        }else{
                            $('.gundong ul').animate({marginTop:mar1-whei+'px'},300)
                        }
                    }
                },3000)

  • 相关阅读:
    (15)如何使用Cocos2d-x 3.0制作基于tilemap的游戏:第三部分(完)
    (14)如何使用Cocos2d-x 3.0制作基于tilemap的游戏:第二部分
    (13)如何使用Cocos2d-x 3.0制作基于tilemap的游戏:第一部分
    (12)瓦片地图
    (11)粒子系统
    (10)场景转换(Transitions)
    (9)SpriteFrameCache和TextureCache
    LeetCode:数组中的第K个最大元素【215】
    LeetCode:累加数【306】
    LeetCode:组合总数III【216】
  • 原文地址:https://www.cnblogs.com/impossible1994727/p/7278538.html
Copyright © 2011-2022 走看看