Here's a fun one! :P This question has been asked here before but none of the answers I've found work for me.
I'm making a web-app and I need the user to use the buttons provided to navigate horizontally between the div's, with manual horizontal scrolling disabled on all browsers for both desktop and touch devices. I assume this requires jQuery? BONUS POINTS: Also if I could disable android zoom, and general vertical scrolling so that my y-scroll is div-specific to make sure the maindiv stays at the top of the window) that would be a huge bonus!
Notes: The app will do all the visual scaling and navigation legwork just like any other app, so please don't bother mentioning that it's unadvised on behalf of end-user accessibility :) Also, overflow-x:hidden; won't work for touch devices. width:100%; definitely won't work because of its use for fitting content to browser width, so I'm guessing jQuery is where my answer lies??
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script type="text/javascript" src="jquery-1.10.2.js"></script>
<style type="text/css">
/*body {overflow-x: hidden;}*/
.maindiv {width:400%; position: relative;}
.sub {width:25%; float:left;}
.content {width:100%; background: yellow;}
.forward {width:20%; background:orange;}.forward:hover{cursor:pointer;}
.back {width:20%; background:pink;}.back:hover{cursor:pointer;}
</style>
</head>
<body>
<div class="maindiv">
<div class="sub">
<div class="content">Page 1</div>
<div class="forward">forward</div>
</div>
<div class="sub">
<div class="back">back</div>
<div class="content">Page 2</div>
<div class="forward">forward</div>
</div>
<div class="sub">
<div class="back">back</div>
<div class="content">Page 3</div>
<div class="forward">forward</div>
</div>
<div class="sub">
<div class="back">back</div>
<div class="content">Page 4</div>
</div>
</div>
<script>
$(document).ready(function(){
$(".forward").click(function(){
$(".maindiv").animate({left:'-=100%'});});})
$(document).ready(function(){
$(".back").click(function(){
$(".maindiv").animate({left:'+=100%'});});})
</script>
</body>
</html>