# How to make a scroll button for Web Browser Module

**URL:** <https://forum.inductiveautomation.com/t/how-to-make-a-scroll-button-for-web-browser-module/15444>\
**Category:** Ignition\
**Created:** [September 22, 2017, 2:21pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-scroll-button-for-web-browser-module/15444 "2017-09-22T14:21:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 22, 2017, 2:21pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-scroll-button-for-web-browser-module/15444/1 "2017-09-22T14:21:37Z")

</div>

We are cooking up something with the Web Browser Module and a good 70% of our ELO touch screens don’t support multitouch and our environment is also very dusty. so we shy away from sliding or swiping controls on the ELOs. I have figured out so far that things like refresh and back and forward are simply the object.refresh() or .back() or .forward(). However I cannot seem to find what will make the screen scroll. I would appreciate any clues Thanks

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [September 26, 2017, 10:35am UTC](https://forum.inductiveautomation.com/t/how-to-make-a-scroll-button-for-web-browser-module/15444/2 "2017-09-26T10:35:56Z")

</div>

Perhaps you can use anchor links on your web pages?

[http://www.echoecho.com/htmllinks08.htm](http://www.echoecho.com/htmllinks08.htm)

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 26, 2017, 12:31pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-scroll-button-for-web-browser-module/15444/3 "2017-09-26T12:31:36Z")

</div>

Thanks for the reply Sanderd17, I really appreciate it. That is actually a pretty nice idea. I don’t have control of the development of the web pages though.

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 26, 2017, 12:48pm UTC](https://forum.inductiveautomation.com/t/how-to-make-a-scroll-button-for-web-browser-module/15444/4 "2017-09-26T12:48:43Z")

</div>

So I was able to create a solution with a lot of hair pulling, time on the jxBrowser site. You can scroll a normal web window, however any document that is viewed in the browsers PDF plugin is relatively out of your control. Adobe proprietary such and such… So my scroll up and down buttons use jxBrowser’s recommended line of code and any pdf plugin content use simulated keystrokes.

```
 from java.awt import Robot
 from java.awt.event import KeyEvent as keyevent
 robot = Robot()
 x = system.tag.read("[Client]currenturl").value
 window = system.gui.getWindow('MAIN')
 browser = window.rootContainer.getComponent('FileBrowser')
 if x[-3:]=="pdf":
     robot.keyPress(keyevent.VK_UP)
     robot.keyRelease(keyevent.VK_UP)
 else:
     browser.getBrowser().executeJavaScript("window.scrollBy(0, -50);")

```

So that is the script for my scroll up button. For scroll down you would simply change the minus 50 in window.scrollBy to 50, and VK\_UP is VK\_DOWN. I suppose I could also use the key event for the regular web page but then it takes away my ability to fine tune the scroll. With the PDF I am currently stuck with either the distance given by the arrow keys or the PageDown Page Up keys. So That was fun.
