...

View Full Version : Newbie: page scrolling by buttons



hualon
10-27-2004, 05: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

joh6nn
10-28-2004, 03:59 AM
anything javascript based would stop working as soon as you went offsite. javascript from one domain isn't allowed to interact with pages from a different domain; it's a security measure. you'll either have to restrict them to your own domain, or deal with normal sized scrollbars.

if your web application is the only thing that will be running on this embedded system, and the content frame is the only thing that will ever scroll, what you could do is make the scrollbars larger, by going to the display properties, go to the appearance tab, select scrollbars from the item menu, and set the size to something like 20



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum