Horizontal scroll refuse to work with the oceanwp theme
-
I used this code in an HTML widget, to achieve a horizontally scrolling website from an elementor tutorial https://www.youtube.com/watch?v=YHpiLblRCx8&t=107s . However, the code works when I switch to the hello theme. Although, it won’t take effect in the frontend (yet to understand why). But it doesn’t show any sign of working (both in the frontend and backend) with the oceanwp theme. The display remains BLOCK.
And it Can’t be because I used elementor free as opposed to the tutorial (already worked in the elementor editor with the Hello theme and Twenty Twenty-two theme).
Please help me, I really need to use this layout with oceanwp. I have wasted so much time on it.
Thanks.
<style>
.elementor-section-wrap{
display: inline-flex !important;
}.elementor-section{
width:100vw !important;
}.custom-width{
width: 100px;
}body{
overflow-y: hidden;
overscroll-behavior-y: none;
}@media (max-width:768px){
.elementor-section-wrap{
display: block;
}
body{
overflow-y:auto;
}
}::-webkit-scrollbar {
height: 10px;
}::-webkit-scrollbar-thumb {
background: #888;
}
</style><script>
function replaceVerticalScrollByHorizontal( event ) {
if ( event.deltaY !== 0 ) {
window.scroll(window.scrollX + event.deltaY * 2, window.scrollY );
event.preventDefault();
}
}const mediaQuery = window.matchMedia( ‘(min-width: 770px)’ );
if ( mediaQuery.matches ) {
window.addEventListener( ‘wheel’, replaceVerticalScrollByHorizontal );
}
</script>
- The topic ‘Horizontal scroll refuse to work with the oceanwp theme’ is closed to new replies.