let touchstartX = 0; document.addEventListener('touchstart', e => { touchstartX = e.changedTouches[0].screenX; }); document.addEventListener('touchend', e => { const endX = e.changedTouches[0].screenX; if (endX < touchstartX - 50) history.back(); }); In the mobile theme’s CSS file (e.g., mobile.css ):
if($mybb->settings['mobile_swipe_back'] && $GLOBALS['mobile_theme_enabled']) { $GLOBALS['headerinclude'] .= "<script>// swipe code here</script>"; } Another popular feature request – toggles dark/light mode. mybb mobile theme
To add a to the MyBB Mobile Theme (e.g., the popular MyBB Mobile or GoMobile plugin/theme), you’ll need to edit template files, add JavaScript/CSS, and possibly modify plugin PHP code. let touchstartX = 0; document