# Perspective scripting equivalent to javascript's 'element.animate()' function?

**URL:** <https://forum.inductiveautomation.com/t/perspective-scripting-equivalent-to-javascripts-element-animate-function/67647>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 15, 2022, 4:58am UTC](https://forum.inductiveautomation.com/t/perspective-scripting-equivalent-to-javascripts-element-animate-function/67647 "2022-12-15T04:58:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elijah\_Nelson](https://avatars.discourse-cdn.com/v4/letter/e/aeb1de/32.png) [@Elijah\_Nelson](https://forum.inductiveautomation.com/u/Elijah_Nelson)\
**Post date:** [December 15, 2022, 4:58am UTC](https://forum.inductiveautomation.com/t/perspective-scripting-equivalent-to-javascripts-element-animate-function/67647/1 "2022-12-15T04:58:43Z")

</div>

I'm currently making a screen that allows you to drag a component around with the mouse, changing its x and y positions on mouseMove. However, its quite choppy. I've seen this done using js before and using the animate() function really smoothed out the movement. How can I replicate this function using Perspective's scripting functionality? Thanks

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 15, 2022, 9:20am UTC](https://forum.inductiveautomation.com/t/perspective-scripting-equivalent-to-javascripts-element-animate-function/67647/2 "2022-12-15T09:20:29Z")

</div>

Does this help?

> [@Perspective Mouse Click & Drag](https://forum.inductiveautomation.com/t/perspective-mouse-click-drag/28583/27):
>
> Soooo.... i was playing around a bit and i found something to inject js in perspective. I know i know crazy_face Its kinda terrible and requires some knowlegde about the perspective react props... But this seems like it would fit here. A little demo, not to complex for drag and drop. Im writing it to a sessionprop, seems to be easier than trying to find the view props. [dndjsinject.zip](https://forum.inductiveautomation.com/uploads/short-url/k9uW6F1ZYMhCSZY1l161wy5UWue.zip) (7.5 KB) @nader.chinichian

---

<div class="post-metadata">

**Author:** ![Elijah\_Nelson](https://avatars.discourse-cdn.com/v4/letter/e/aeb1de/32.png) [@Elijah\_Nelson](https://forum.inductiveautomation.com/u/Elijah_Nelson)\
**Post date:** [December 16, 2022, 5:47am UTC](https://forum.inductiveautomation.com/t/perspective-scripting-equivalent-to-javascripts-element-animate-function/67647/3 "2022-12-16T05:47:44Z")

</div>

That markdown trick is so dodgy but it works! Cheers
