获取

直接访问 Lately.js 的 GitHub 来获取最新版插件,或通过链接下载 Lately.js:

lately.js or lately.min.js

格式

支持可直传 JavaScript 对象的时间格式。new Date()

引用

<script src="//tokinx.github.io/lately/lately.min.js"></script>

启用

<script>
    Lately({
        'target' : '.lately-a,.lately-b,.lately-c'
    })
</script>

示例

// DateTime
<time class="lately-a" datetime="2016-09-28T23:49:41+00:00" itemprop="datePublished" pubdate>2016-September-28</time>

// Title
<a href="#" class="lately-b" title="2017-02-14 18:56">Any string</a>

// HTML
<a href="#" class="lately-c">2017-02-12 21:39</a>