A Challenge! (Setting table cell background permanently)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gary Hasler

    #1

    A Challenge! (Setting table cell background permanently)

    I have a full page of thumbnails linked to home plan pages. I'm adding
    a mouseover/mouseout effect to the table cells, plus a onclick event to
    permanently set the cell background to indicate the user's latest
    choice. This is in addition to the normal A HREF link, and seems to
    work fine. I set up anchors (A name="") on the thumbnail page, and the
    "Back to Plans" link from the home plan page contains a hash (#) to
    scroll the page down and also re-highlight the appropriate table cell.

    This works great if the user uses my link to return to the thumbnail
    page. But what I would REALLY like is if it also worked if they click
    their browser's Back button instead! Can anyone think of a way to do
    this? I know the browser remembers certain things about the previous
    page, such as contents of form fields and where the user has scrolled
    to.

    The test page is at:


  • Lasse Reichstein Nielsen

    #2
    Re: A Challenge! (Setting table cell background permanently)

    Gary Hasler <garyhasler@tel us.net> writes:
    [color=blue]
    > I know the browser remembers certain things about the previous page,
    > such as contents of form fields and where the user has scrolled to.[/color]

    That depends *heavily* on the browser.

    E.g., Opera keeps the page active in memory (as far as the memory
    cache allows), and going back to the page will not reinitialize it at
    all, just continue where it left. (That's actually the best you can get,
    you can just highlight the cell when it's clicked).

    Mozilla FireFox reinitializes/reloads the page and doesn't seem to
    remember the values of form controls.

    IE reloads the page and reinstates the value of form controls.

    By best suggestion is to use a cookie, if you want to remember from
    access to access, whether by "back" key or not (and know that not all
    browsers reloads the page when clicking "back").

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Gary Hasler

      #3
      Re: A Challenge! (Setting table cell background permanently)

      That's kinda what I thought. I'm not sure it's worth getting into cookies,
      especially as so many people (myself included) have turned cookies off at times,
      or changed the setting to "prompt", for whatever reasons. The other alternative
      I've considered is changing the page to a PHP page and getting into
      sessions...but that might be more trouble than it's worth for the result.

      However, you just gave me an idea....what if the onClick js function sets a
      hidden form element to the value of the clicked link? I'll give that a try...
      ---------------------

      Lasse Reichstein Nielsen wrote:
      [color=blue]
      > Gary Hasler <garyhasler@tel us.net> writes:
      >[color=green]
      > > I know the browser remembers certain things about the previous page,
      > > such as contents of form fields and where the user has scrolled to.[/color]
      >
      > That depends *heavily* on the browser.
      >
      > E.g., Opera keeps the page active in memory (as far as the memory
      > cache allows), and going back to the page will not reinitialize it at
      > all, just continue where it left. (That's actually the best you can get,
      > you can just highlight the cell when it's clicked).
      >
      > Mozilla FireFox reinitializes/reloads the page and doesn't seem to
      > remember the values of form controls.
      >
      > IE reloads the page and reinstates the value of form controls.
      >
      > By best suggestion is to use a cookie, if you want to remember from
      > access to access, whether by "back" key or not (and know that not all
      > browsers reloads the page when clicking "back").
      >
      > /L
      > --
      > Lasse Reichstein Nielsen - lrn@hotpop.com
      > DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
      > 'Faith without judgement merely degrades the spirit divine.'[/color]

      Comment

      • Frank

        #4
        Re: A Challenge! (Setting table cell background permanently)

        Gary,

        before thinking of a technical solution, think about the functional first.
        What do you want when the user gets back. Where will the mouse be and which
        image is highlighted? When do you switch off the highlight of the choice the
        user made the first time?
        Frank
        "Gary Hasler" <garyhasler@tel us.net> wrote in message
        news:40FC0845.D F55BB8@telus.ne t...[color=blue]
        > I have a full page of thumbnails linked to home plan pages. I'm adding
        > a mouseover/mouseout effect to the table cells, plus a onclick event to
        > permanently set the cell background to indicate the user's latest
        > choice. This is in addition to the normal A HREF link, and seems to
        > work fine. I set up anchors (A name="") on the thumbnail page, and the
        > "Back to Plans" link from the home plan page contains a hash (#) to
        > scroll the page down and also re-highlight the appropriate table cell.
        >
        > This works great if the user uses my link to return to the thumbnail
        > page. But what I would REALLY like is if it also worked if they click
        > their browser's Back button instead! Can anyone think of a way to do
        > this? I know the browser remembers certain things about the previous
        > page, such as contents of form fields and where the user has scrolled
        > to.
        >
        > The test page is at:
        > http://www.thelogconnection.com/stock_plansx.html
        >[/color]


        Comment

        • Gary Hasler

          #5
          Re: A Challenge! (Setting table cell background permanently)

          Actually, I don't want to change much. The intent is for the visitor to remember
          where they are in the thumbnail table, as they may spend several minutes viewing
          the house plan. The highlight is a typical mouseover, and when the user clicks
          the highlight becomes permanent and the previous highlight is de-highlighted (is
          that a word?)

          When the user clicks the browser back button, the window scroll position will be
          wherever it was when the page was unloaded. That's perfect, so I want to ignore
          the # anchor in that case, which for instance IE does even though the anchor
          still shows in the address bar. The only thing I want is the highlight to
          remind them which one they picked. Maybe I can do something with the
          link.visited property?
          ---------------------------------

          Frank wrote:
          [color=blue]
          > Gary,
          >
          > before thinking of a technical solution, think about the functional first.
          > What do you want when the user gets back. Where will the mouse be and which
          > image is highlighted? When do you switch off the highlight of the choice the
          > user made the first time?
          > Frank
          > "Gary Hasler" <garyhasler@tel us.net> wrote in message
          > news:40FC0845.D F55BB8@telus.ne t...[color=green]
          > > I have a full page of thumbnails linked to home plan pages. I'm adding
          > > a mouseover/mouseout effect to the table cells, plus a onclick event to
          > > permanently set the cell background to indicate the user's latest
          > > choice. This is in addition to the normal A HREF link, and seems to
          > > work fine. I set up anchors (A name="") on the thumbnail page, and the
          > > "Back to Plans" link from the home plan page contains a hash (#) to
          > > scroll the page down and also re-highlight the appropriate table cell.
          > >
          > > This works great if the user uses my link to return to the thumbnail
          > > page. But what I would REALLY like is if it also worked if they click
          > > their browser's Back button instead! Can anyone think of a way to do
          > > this? I know the browser remembers certain things about the previous
          > > page, such as contents of form fields and where the user has scrolled
          > > to.
          > >
          > > The test page is at:
          > > http://www.thelogconnection.com/stock_plansx.html
          > >[/color][/color]

          Comment

          Working...