scrolling iFrame with button and javascript for touchscreen
Posted: Wed Sep 21, 2005 5:58 pm
Hi all, I have an iframe in a site, it gets long and you have to scroll a long way down to see some of the content.
I'm designing this for touch screen and the scroll bars are just too thin and fiddly for our fat fingers
so what I want to do is have a button above the iframe and one below. When you click that button (in this case an image) I want the iframe contents to scroll up or down (dependant on the button pressed).
Here is the code I'm trying, but am having no success, the thing is not even moving at all
the iframe is called 'content' and well, I just don't really understand what's wrong (having done VERY little javascript).
Any help greatly appreciated.
Rob
(EDIT: Values of 1 and 100 shown here are just to see if I could get some movement before I even try scrolling)
I'm designing this for touch screen and the scroll bars are just too thin and fiddly for our fat fingers
Here is the code I'm trying, but am having no success, the thing is not even moving at all
Code: Select all
<td width="300" rowspan="3" align="center" class="scroll_box" background="images/background.jpg">
<img src="images/U.jpg" onMouseDown="document.content.scrollx.value = 1"><br>
<?
echo "<div align=\"center\">
<iframe name=\"content\" src=\"clients_viewbox.php?letter=$letter\" width=\"90%\" height=\"500\" frameborder=\"0\" scrolling=\"auto\">
No i-frames, eh? Pity.<br>Go get a better browser.
</iframe>
</div>";
?>
<br><img src="images/D.jpg" onMouseDown="document.content.ScrollY.value = 100">
</td>Any help greatly appreciated.
Rob
(EDIT: Values of 1 and 100 shown here are just to see if I could get some movement before I even try scrolling)