寻求数字滚动增加的插件
老白,又来讨教了,现在想在网页顶部加一个数字不断滚动增加的效果。
类似这个网页底部的效果:https://www.bluejeans.com/
可能要翻墙才能看到,我截了个图。
额,新版页面不会插入图片。
就是一排数字,最后面的数字向上滚动,然后整体不断增加。
类似这个网页底部的效果:https://www.bluejeans.com/
可能要翻墙才能看到,我截了个图。
额,新版页面不会插入图片。
就是一排数字,最后面的数字向上滚动,然后整体不断增加。
没有找到相关结果
已邀请:
4 个回复
~~~~~~~~~ - 上帝给我的使命,就是证明你们都不是最糟糕的
赞同来自:
~~~~~~~~~ - 上帝给我的使命,就是证明你们都不是最糟糕的
赞同来自:
它是用 Drupal 搭建的
。那个计数器正是通过 JavaScript 实现的,在某个 JS 文件(文件名动态变化,因为网站启用了 JS 合并、压缩、缓存)中找到了相关代码片段:function getRandomInt(min,max){return Math.floor(Math.random()*(max-min+1))+min}function updateMinutes(){var current=stripCommasToInt(minDiv.html())return current+=getRandomInt(minutesPerSec-2,minutesPerSec+2),numberWithCommas(current)}if($("body").hasClass("front")){var minDiv=$(".minutes_counter"),originalBjnMinutes=1422468482,originalSeconds=1460065339,minutesPerSec=4;Date.now||(Date.now=function(){return(new Date).getTime()})var utcSeconds=Math.floor(Date.now()/1e3),timeElapsed=utcSeconds-originalSeconds,currentTotal=timeElapsed*(10*minutesPerSec)+originalBjnMinutes;minDiv.html(numberWithCommas(currentTotal)).addClass("show")setInterval(function(){minDiv.html(updateMinutes())},100)}}),
孤独者 - 世界属于那些勤于思考的人,更属于那些善于行动的人
赞同来自:
在 Joomla 3 后台“扩展 - 模块管理”中,新建一个模块,类型选择为“自定义 HTML”,打开模块参数之后,将输入框的编辑器切换成源代码模式,然后填写下列代码:
function countup(startingdate, base){
this.currentTime=new Date()
this.startingdate=new Date(startingdate)
this.base=base
this.start()
}
countup.prototype.oncountup=function(){}
countup.prototype.start=function(){
var thisobj=this
this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
var timediff=(this.currentTime-this.startingdate)/1000
var secondfield=Math.floor((timediff))
var result={seconds:secondfield}
this.oncountup(result)
setTimeout(function(){thisobj.start()}, 1000)
}
这里输入数字上面的文字
var startDate=new countup("February 4, 2010 14:41:00", "seconds") // 修改第一个双引号之内的日期就能改变初始值
startDate.oncountup=function(result)
{
var mycountainer=document.getElementById("holder")
mycountainer.innerHTML=+result['seconds']
}
这里输入数字下面的文字
不是本人 - no no no!
赞同来自: