How do I run this function If I click on the button?
<button id="button">Button</button>
var tween = new TWEEN.Tween(mesh.scale).to({ x: 1, y: 0.05, z:2 }, 1000).start();
tween.easing(TWEEN.Easing.Elastic.InOut);
tween.repeat(Infinity);
tween.yoyo(true);
Using jQuery:
$('#button').click(function(){
var tween = new TWEEN.Tween(mesh.scale).to({ x: 1, y: 0.05, z:2 }, 1000).start();
tween.easing(TWEEN.Easing.Elastic.InOut);
tween.repeat(Infinity);
tween.yoyo(true);
return false; //if you want the button to not process anything further
});
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments