javascript - 使用 CSS 制作二进制数动画

标签 javascript jquery css html

是否可以使用 CSS(和/或 HTML5/JQuery/Javascript)实现以下动画(http://www.motionbackgroundsforfree.com/technology-free-backgrounds/free-technology-background-binary-horizon/)?

想要全屏背景,二进制文件在右侧作为循环流出。

谢谢。

最佳答案

这是我做的:

$(document).ready(function() {
  var lines = 10;
  var textLength = 40;

  for (i = 0; i < lines - 1; i++) {
    $(".num").first().clone().insertAfter($(".num").first());
  }


  setInterval(function() {
    $(".num").each(function() {
      if ($(this).text().length < textLength) {
        $(this).text(($(this).text() + Math.round(Math.random())));
      } else {
        $(this).text(Math.round(Math.random()) + $(this).text().substring(0, $(this).text().length - 1))
      }
    });

  }, 75);

});

Here is the JSFiddle demo

你可以进一步调整它:)

关于javascript - 使用 CSS 制作二进制数动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34786192/

相关文章:

javascript - Twitter Bootstrap 下拉菜单 - onclick 将 'open' 类放在祖先 ul 而不是子 ul 上

php - 如何使用 jquery-ui-map 在谷歌地图上添加标记

javascript - 改进 View 文件中的 JavaScript 代码

html - div 的数据背景属性和图像未显示

javascript - KnockoutJS,如何使用可编辑的 HTML5 内容更新 View 模型?

javascript - 如何在保持图像响应的同时使图像居中?

javascript - 动态改变颜色

javascript - div onclick函数更改正文背景图像

html - 什么是更快地加载图像的最佳方式,.png/.jpg 格式或数据 URI 方案?

html - CSS 动画在 wow js 中无法正常工作