I want to design a horizontal page. When I use mouse wheel it just scrolls content vertically. How can I use horizontal scroll by mouse wheel? Does CSS support this property?
For example any thing like this:
mouse-wheel:horizontal;
I dont want jQuery solutions.
We can scroll the page horizontally by SHIFT key + scroll through mouse.
If you wish to make your mouse scroll horizontally Press SHIFT and then use the Middle mouse scroll wheel. This works if the page is large enough to be scrolled horizontally. You could see a scroll bar at the bottom. You could also press the middle mouse button once.
For horizontal scrollable bar use the x and y-axis. Set the overflow-y: hidden; and overflow-x: auto; that will automatically hide the vertical scroll bar and present only the horizontal scrollbar. The white-space: nowrap; property is used to wrap text in a single line.
We can scroll the page horizontally by SHIFT key + scroll through mouse.
var item = document.getElementById("MAIN");
window.addEventListener("wheel", function (e) {
if (e.deltaY > 0) item.scrollLeft += 100;
else item.scrollLeft -= 100;
});
Where "MAIN"
is your container
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With