Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Added from_zero option #114

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion odometer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,12 @@ Odometer.init = ->
elements = document.querySelectorAll (Odometer.options.selector or '.odometer')

for el in elements
el.odometer = new Odometer {el, value: (el.innerText ? el.textContent)}
value = el.innerText ? el.textContent
if Odometer.options.from isnt undefined
el.odometer = new Odometer {el, value: Odometer.options.from}
el.innerHTML = value
else
el.odometer = new Odometer {el, value: value}

if document.documentElement?.doScroll? and document.createEventObject?
# IE < 9
Expand Down
19 changes: 14 additions & 5 deletions odometer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading