hualon
10-27-2004, 04:31 PM
I have a little frames website (and yes, I need frames for this) that has a header frame and a main frame. I'm designing this site for touchpanel use so I want to have either a) an enlarged scroll bar or b) scroll up and scroll down buttons.
This application is specifically for ONE touchpanel based PC running some flavor of embedded Windows with some recentish version of embedded IE.
The framset looks like this:
<frameset rows="115,*" BORDER="0" FRAMEBORDER="0" FRAMESPACING="0">
<frame name="header" src="header.php" scrolling="no" noresize>
<frame name="main" src="portal.php" scrolling="yes" noresize>
</frameset>
I want the scroll up/down buttons to be in the header frame so that they can always be on-screen to scroll the main frame (no matter what page is in it). I've implemented the code below which works fine as long as the page loaded into 'main' is the default loaded by the frameset but as soon as you go offsite (in this case, to a recipe search site or yahoo finance or something), the scroll buttons stop working. I don't know enough about Javascript to make it work the way I want.
<script language="JavaScript"><!--
document.write('<form>');
document.write('<input type="button" value="Scroll Up" onClick="parent.main.scrollBy(0,-100)"><p>');
document.write('<input type="button" value="Scroll Down" onClick="parent.main.scrollBy(0,100)">');
document.write('<\/form>');
//-->
</script>
I'm not sure but I think that the problem I'm having is because of frame referencing but frames and javascript are new to me.
Thanks,
Jon
This application is specifically for ONE touchpanel based PC running some flavor of embedded Windows with some recentish version of embedded IE.
The framset looks like this:
<frameset rows="115,*" BORDER="0" FRAMEBORDER="0" FRAMESPACING="0">
<frame name="header" src="header.php" scrolling="no" noresize>
<frame name="main" src="portal.php" scrolling="yes" noresize>
</frameset>
I want the scroll up/down buttons to be in the header frame so that they can always be on-screen to scroll the main frame (no matter what page is in it). I've implemented the code below which works fine as long as the page loaded into 'main' is the default loaded by the frameset but as soon as you go offsite (in this case, to a recipe search site or yahoo finance or something), the scroll buttons stop working. I don't know enough about Javascript to make it work the way I want.
<script language="JavaScript"><!--
document.write('<form>');
document.write('<input type="button" value="Scroll Up" onClick="parent.main.scrollBy(0,-100)"><p>');
document.write('<input type="button" value="Scroll Down" onClick="parent.main.scrollBy(0,100)">');
document.write('<\/form>');
//-->
</script>
I'm not sure but I think that the problem I'm having is because of frame referencing but frames and javascript are new to me.
Thanks,
Jon