# How to change the cursor dynamically

**URL:** <https://pdfjs.community/t/how-to-change-the-cursor-dynamically/1027>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [October 5, 2021, 7:30pm UTC](https://pdfjs.community/t/how-to-change-the-cursor-dynamically/1027 "2021-10-05T19:30:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drevel](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@drevel](https://pdfjs.community/u/drevel)\
**Post date:** [October 5, 2021, 7:30pm UTC](https://pdfjs.community/t/how-to-change-the-cursor-dynamically/1027/1 "2021-10-05T19:30:25Z")

</div>

Dear support,

I’m trying to change the cursor appearance when the mouse is moving above the webViewer area. I’m wondering if it is possible.

I’m trying to do things like that, but it does not work…

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/8593f36c9983cf53b53fae61611c4082e197cb98.png)

I thank to you in advance !  
Best Regards,

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [October 5, 2021, 7:30pm UTC](https://pdfjs.community/t/how-to-change-the-cursor-dynamically/1027/2 "2021-10-05T19:30:27Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Integrating new Blazor project with PDF.js Express - Use more WebViewer APIs](https://pdfjs.express/documentation/get-started/blazor/new-project#use-more-webviewer-apis)
- [Integrating Svelte with PDF.js Express - Use more WebViewer APIs](https://pdfjs.express/documentation/get-started/svelte#use-more-webviewer-apis)
- [Integrating Cordova with PDF.js Express - Use more WebViewer APIs](https://pdfjs.express/documentation/get-started/cordova#use-more-webviewer-apis)

APIs:
- [UndefinedWebViewer(options, viewerElement)](https://pdfjs.express/api/global.html#WebViewer__anchor)
- [CoreControls.WidgetEditingManager - editingStarted](https://pdfjs.express/api/7.0/CoreControls.WidgetEditingManager.html#event:editingStarted__anchor)
- [UI - dangerouslySetNoteTransformFunction(noteTransformFunction)](https://pdfjs.express/api/UI.html#.dangerouslySetNoteTransformFunction__anchor)

Forums:
- [Mouse Coordinates / Annotations Coordinates](https://pdfjs.community/t/mouse-coordinates-annotations-coordinates/1014/1)
- [How to apply Rubber stamp annotation without explicitly selecting stamp. (SOS)](https://pdfjs.community/t/how-to-apply-rubber-stamp-annotation-without-explicitly-selecting-stamp-sos/198/1)
- [How to Pan while tracing by pressing and holding the left click of the mouse](https://pdfjs.community/t/how-to-pan-while-tracing-by-pressing-and-holding-the-left-click-of-the-mouse/531/1)

---

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [October 6, 2021, 7:51pm UTC](https://pdfjs.community/t/how-to-change-the-cursor-dynamically/1027/3 "2021-10-06T19:51:54Z")

</div>

Hey!

Express is mounted in an iframe so you need to listen to the iframes window instead of the root window

```javascript
  instance.UI.iframeWindow.addEventListener('mousemove', () => {
    instance.UI.iframeWindow.document.body.style.cursor = 'crosshair'
  })

```

Logan
