# I is it possible to auto move webpage horizontal scrollbar?

**URL:** <https://forum.xojo.com/t/i-is-it-possible-to-auto-move-webpage-horizontal-scrollbar/64010>\
**Category:** Web\
**Created:** [June 19, 2021, 2:35am UTC](https://forum.xojo.com/t/i-is-it-possible-to-auto-move-webpage-horizontal-scrollbar/64010 "2021-06-19T02:35:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronaldo\_florendo](https://forum.xojo.com/user_avatar/forum.xojo.com/ronaldo_florendo/32/159_2.png) [@ronaldo\_florendo](https://forum.xojo.com/u/ronaldo_florendo)\
**Post date:** [June 19, 2021, 2:35am UTC](https://forum.xojo.com/t/i-is-it-possible-to-auto-move-webpage-horizontal-scrollbar/64010/1 "2021-06-19T02:35:23Z")

</div>

I have a web page that has lots of item in it and can scroll horizontally. Is there a way to programmatically move horizontal scroll bar to the right most of the webpage?

---

<div class="post-metadata">

**Author:** ![Jeannot\_Muller](https://forum.xojo.com/user_avatar/forum.xojo.com/jeannot_muller/32/13359_2.png) [@Jeannot\_Muller](https://forum.xojo.com/u/Jeannot_Muller)\
**Post date:** [June 19, 2021, 9:13am UTC](https://forum.xojo.com/t/i-is-it-possible-to-auto-move-webpage-horizontal-scrollbar/64010/2 "2021-06-19T09:13:55Z")

</div>

You could move the whole window, for instance, that might be the best approach, in this case.

 ![Screenshot 2021-06-19 at 11.10.18](https://forum.xojo.com/uploads/default/original/2X/5/573c25a145bd12330e8578608786428d7d14b019.jpeg)

Click on the button leads to:

 ![Screenshot 2021-06-19 at 11.10.23](https://forum.xojo.com/uploads/default/original/2X/e/ee5730e15268c9d81f8fd21bdaa9c7dce0eb9a85.jpeg)

Code in the button’s pressed event:

`me.ExecuteJavaScript("window.scrollTo({ top: 0, left: 2500, behavior: 'smooth' });")`

Not sure though, if it is smart doing this. All users have different approaches, different window sizes, different behaviors, different expectations. Ask yourself the question: how often have you seen a button, scrolling a webpage to horizontally to a different position? ;-). I’m not saying that it is wrong, but you should always ask yourself such questions, and/or if it might be better to design your webpage in a different way.

---

<div class="post-metadata">

**Author:** ![ronaldo\_florendo](https://forum.xojo.com/user_avatar/forum.xojo.com/ronaldo_florendo/32/159_2.png) [@ronaldo\_florendo](https://forum.xojo.com/u/ronaldo_florendo)\
**Post date:** [June 19, 2021, 12:59pm UTC](https://forum.xojo.com/t/i-is-it-possible-to-auto-move-webpage-horizontal-scrollbar/64010/3 "2021-06-19T12:59:23Z")

</div>

This things work!

How I wish it will have a xojo command to do the same things.  
Thank you Mr. Muller!

---

<div class="post-metadata">

**Author:** ![Jeannot\_Muller](https://forum.xojo.com/user_avatar/forum.xojo.com/jeannot_muller/32/13359_2.png) [@Jeannot\_Muller](https://forum.xojo.com/u/Jeannot_Muller)\
**Post date:** [June 20, 2021, 10:24am UTC](https://forum.xojo.com/t/i-is-it-possible-to-auto-move-webpage-horizontal-scrollbar/64010/4 "2021-06-20T10:24:01Z")

</div>

> [@ronaldo\_florendo](#):
>
> How I wish it will have a xojo command to do the same things.

You can see it “differently” too 😉 : at least it is possible. One major challenge is, that the possibilities in CSS are almost endless. It would probably not make sense to integrate them all. Now I do agree, that it would be very nice to have more options with Xojo Code, but it will be hard for Xojo to decide, what is needed by - let’s say - the majority of users.

---

<div class="post-metadata">

**Author:** ![ronaldo\_florendo](https://forum.xojo.com/user_avatar/forum.xojo.com/ronaldo_florendo/32/159_2.png) [@ronaldo\_florendo](https://forum.xojo.com/u/ronaldo_florendo)\
**Post date:** [June 20, 2021, 3:38pm UTC](https://forum.xojo.com/t/i-is-it-possible-to-auto-move-webpage-horizontal-scrollbar/64010/5 "2021-06-20T15:38:27Z")

</div>

Agree.

The reason why I dive to xojo because it helps to relieved from difficulties on understanding css/javascript.

If xojo will require me to understand it more, it might push me to learn php or java and left xojo. in the future.
