model_viewer_plus.dart icon indicating copy to clipboard operation
model_viewer_plus.dart copied to clipboard

Play next animation when click/tap on model

Open nal-khangpt opened this issue 3 years ago • 3 comments

Is there any plan to supply this feature in future?

nal-khangpt avatar Mar 29 '22 02:03 nal-khangpt

+1 And other . reload webpage , reload model ,anim

thanks

xiegaoxi001 avatar May 17 '22 09:05 xiegaoxi001

I want a detailed way to change the animation

ghdl023 avatar Jul 05 '22 05:07 ghdl023

String js = '''
  const modelViewer = document.querySelector('#widget');
  modelViewer.addEventListener('click', event => {
    var ani = modelViewer.animationName === 'idle' ? 'anotherAni' : 'idle';
    modelViewer.setAttribute('animation-name', ani);
  });
''';

change modeview attr.

autoPlay: true, animationName: "idle" relatedJs: js

jams777 avatar Jul 11 '22 08:07 jams777