zemax / jquery-splitFlap

SplitFlap display plugin for jQuery
MIT License
53 stars 20 forks source link

Question about text update without animation #14

Open vincenzodesanctis opened 7 years ago

vincenzodesanctis commented 7 years ago

First of all congratulation for your interesting jquery-slipFlap. The question is this: is there a easy way to update a text in the same row without re-animation? I mean, suppose to load a json object every few minutes, if the row (same line) has the same value comparing to the previous one than do not update and do not animate. How to achieve it?

example: old

JSON = {
    "num":100,
    "name":"test.com",
    "messages":"msg"
}

action: animation....

new

JSON = {
    "num":100,
    "name":"test.com",
    "messages":"msg"
}

action: no animation (leave the previuos one because equal to the previous one)

vincenzodesanctis commented 7 years ago

Maybe the trick is to pass the text directly to the textInit variable and put autoplay to false.

if json_old[first row] = json_new[first row] than
###do not update but leave the text whitout animation
 $('.my-spliflap').splitFlap({textInit: 'text row'});
 $('.my-spliflap').splitFlap({autoplay: false});

is it correct way?