zoukankan      html  css  js  c++  java
  • jquery 数字滚动到指定数字

    <div id="hhui" class="hhui">
    <div class="mid ys2">
    <div class="mt mt1">
    <div class="mtimg"><img src="/images/b1.jpg" alt="" width="69" height="69" /></div>
    <div class="mtttt">18</div>
    <div class="mttcc">Has rich industrial production experience, has been engaged in the development of machine tools</div>
    </div>
    <div class="mt mt2">
    <div class="mtimg"><img src="/images/b2.jpg" alt="" width="69" height="69" /></div>
    <div class="mtttt">40000</div>
    <div class="mttcc">The company occupies more than 40,000 square meters, plant more than 20,000 square meters</div>
    </div>
    <div class="mt mt3">
    <div class="mtimg"><img src="/images/b3.jpg" alt="" width="69" height="69" /></div>
    <div class="mtttt">120</div>
    <div class="mttcc">Engineers and technicians account for 20% of the total number of employees</div>
    </div>
    <div class="mt mt4 last">
    <div class="mtimg"><img src="/images/b4.jpg" alt="" width="69" height="69" /></div>
    <div class="mtttt">60</div>
    <div class="mttcc">The company has more than 60 models of products</div>
    </div>
    </div>
    <div class="clear">&nbsp;</div>
    </div>
    <script type="text/javascript">// <![CDATA[
    var ais=1;
    $(window).scroll(function() {
    
     var sb=$("#hhui").offset().top;
     var oTop=document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop;//IE和chrome获取方式不一样
     var sa=oTop-document.body.clientHeight;
    
    if(oTop+$(window).height()-160>sb&& ais==1)
    {    console.log(2);
        ais=2;
            $('.mtttt').each(function(){
            $(this).prop('Counters',0).animate({
                Crs: $(this).text()
            },{
                duration: 3000,
                easing: 'swing',
                step: function (now){
                    $(this).text(Math.ceil(now));
                }
            });
        });    
    }  
    });
    // ]]></script>
  • 相关阅读:
    Spring 拦截器postHandle无法修改Response的原因
    使用AShot进行网页全页截图
    60句简短的话 句句在理
    天使
    路过青春的合欢树
    Velocity日期格式化
    高斯模糊的Java实现
    MyBatis架构与源码分析<资料收集>
    柳青(Jean)英文演讲集合
    hive sql 常见异常
  • 原文地址:https://www.cnblogs.com/zywf/p/9894974.html
Copyright © 2011-2022 走看看