2. js //Quote//This is from Define functions (need to be called in the page)&l"/> 2. js //Quote//This is from Define functions (need to be called in the page)&l">

Home  >  Article  >  Web Front-end  >  Use jQuery to implement a three-dimensional digital scroll bar to increase the effect example

Use jQuery to implement a three-dimensional digital scroll bar to increase the effect example

怪我咯
怪我咯Original
2017-03-29 15:57:361834browse

jqueryTo achieve the effect of adding a three-dimensional digital scroll bar, the code is divided into two parts, one part is the html structure and the other part belongs to the js code segment, which is required Friends, please refer to it!

1, html structure

<p class="numberRun1"></p>

2, js

<script type="text/javascript" src="js/digital_over.js" ></script>//引用
//这是自定义函数(需要在页面中进行调用)
<script>
  //数字滚动
  function digitalScroll(obj,n){
    var numRun = $(obj).numberAnimate({num:n, speed:2000, symbol:","});
    var nums = n;
    setInterval(function(){
      numRun.resetData(nums);
    },3000);
    var numWidth= $(obj).width();
    $(obj).find(&#39;.mt-number-animate&#39;).css(&#39;width&#39;,numWidth);
    $(obj).css(&#39;width&#39;,&#39;100%&#39;);
    $(obj).find(&#39;.mt-number-animate&#39;).css(&#39;margin&#39;,&#39;0 auto&#39;);
  }
  window.indexdigitalScroll=function(){
    digitalScroll($(&#39;.numberRun1&#39;),1160518);
  }
</script>
<!--这是在页面中调用的方法-->
<script>
  $(function(){
    indexdigitalScroll();
    });
</script>


3, Picture case

Use jQuery to implement a three-dimensional digital scroll bar to increase the effect example

The above is the detailed content of Use jQuery to implement a three-dimensional digital scroll bar to increase the effect example. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn