# Zoom by using mouse scroll (Not by using ctrl+scroll)

**URL:** <https://pdfjs.community/t/zoom-by-using-mouse-scroll-not-by-using-ctrl-scroll/111>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [July 3, 2020, 4:06pm UTC](https://pdfjs.community/t/zoom-by-using-mouse-scroll-not-by-using-ctrl-scroll/111 "2020-07-03T16:06:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran.patil](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@kiran.patil](https://pdfjs.community/u/kiran.patil)\
**Post date:** [July 3, 2020, 4:06pm UTC](https://pdfjs.community/t/zoom-by-using-mouse-scroll-not-by-using-ctrl-scroll/111/1 "2020-07-03T16:06:58Z")

</div>

I want to zoom in and out by using mouse scroll instead of using CTRL+MOUSESCROLL. I am using a single paged pdf so by using mouse scroll should zoom in and zoom out to the point where mouse is pointing.  
I have implemented this much of code for zoom in and out but **it wont zoom with respect to the mouse pointer’s location**. Instead it zooms to the top left corner of the page.  
Let me know how to make this work perfectly!  
Here ,  
public static ZOOM\_OUT = 1.25;  
public static ZOOM\_IN = 0.8;

 ![zoom](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/04724aac69a76b90031ffe8a17d3a7e1309a3802.png)

---

<div class="post-metadata">

**Author:** ![zzhang](https://avatars.discourse-cdn.com/v4/letter/z/b9e5f3/32.png) [@zzhang](https://pdfjs.community/u/zzhang)\
**Post date:** [July 13, 2020, 4:31pm UTC](https://pdfjs.community/t/zoom-by-using-mouse-scroll-not-by-using-ctrl-scroll/111/2 "2020-07-13T16:31:18Z")

</div>

Hi,

The second and third arguments are the offset values to the current mouse position. If you want to zoom in with respect to the current mouse position then you actually don’t want to have any offsets. I think if you just pass **0** and **0** in it should work.

Thanks,  
Zhijie

---

<div class="post-metadata">

**Author:** ![zzhang](https://avatars.discourse-cdn.com/v4/letter/z/b9e5f3/32.png) [@zzhang](https://pdfjs.community/u/zzhang)\
**Post date:** [July 22, 2020, 3:17pm UTC](https://pdfjs.community/t/zoom-by-using-mouse-scroll-not-by-using-ctrl-scroll/111/3 "2020-07-22T15:17:16Z")

</div>


