Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2004
    Thanked 0 Times in 0 Posts

    Newbie: page scrolling by buttons

    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>
    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('<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)">');
    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.


  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    72° W. 48' 57" , 41° N. 32' 04"
    Thanked 1 Time in 1 Post
    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
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts