Complex sticky rollovers on map.

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

    #1

    Complex sticky rollovers on map.

    Hi there.

    Tricky one this. I am thinking of creating a map of our county
    (Northamptonshi re, UK) but I want users to be able to select 2 or more
    areas by clicking on them once.

    When they have picked say 3 areas, if they then click a next/submit
    button the codes for the selected areas are passed to the next page.

    I envision a different colour rollover and a third colour for the
    selected state.

    Would it then be possible to deselect an area by clicking it again????

    This is bassically for a vacancies website.

    Not sure how easy this would be, I am a designer rather than
    programmer so you'll have to spell it out.

    In fact thinking this through it might all be easier in Flash??? I
    shall ponder on that.


    TIA
    Luke
  • Larry Bud

    #2
    Re: Complex sticky rollovers on map.

    lharby@hotmail. com (Luke) wrote in message news:<e4db459b. 0406300548.2bbf e156@posting.go ogle.com>...[color=blue]
    > Hi there.
    >
    > Tricky one this. I am thinking of creating a map of our county
    > (Northamptonshi re, UK) but I want users to be able to select 2 or more
    > areas by clicking on them once.
    >
    > When they have picked say 3 areas, if they then click a next/submit
    > button the codes for the selected areas are passed to the next page.
    >
    > I envision a different colour rollover and a third colour for the
    > selected state.
    >
    > Would it then be possible to deselect an area by clicking it again????[/color]

    This is all possible. You'd have to keep the selected items in some
    sort of array, then roll out the first selected as a new one comes in
    (FIFO-first in, first out).

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Complex sticky rollovers on map.

      Larry Bud wrote:[color=blue]
      > lharby@hotmail. com (Luke) wrote in message news:<e4db459b. 0406300548.2bbf e156@posting.go ogle.com>...[/color]

      Please do not write attribution novels.
      [color=blue][color=green]
      >> [...] I am thinking of creating a map of our county
      >> (Northamptonshi re, UK) but I want users to be able
      >> to select 2 or more areas by clicking on them once.
      >>
      >> When they have picked say 3 areas, if they then click a next/submit
      >> button the codes for the selected areas are passed to the next page.
      >> [...]
      >> Would it then be possible to deselect an area by clicking it again????[/color][/color]

      Your Question Mark key is borken. [psf 2.3]
      [color=blue]
      > This is all possible. You'd have to keep the selected items in some
      > sort of array, then roll out the first selected as a new one comes in
      > (FIFO-first in, first out).[/color]

      It seems to me that you have misunderstood the request. A FIFO (queue)
      would not be an appropriate data structure, AIUI he does not want the
      area to be deselected automatically if a certain number has been
      selected. An associative array would be. There is no such data
      structure in ECMAScript and its implementations , but an object can
      provide the functionality of it:

      var areas = {
      items: {},
      toggle: function(a) {
      if (typeof this.items[a] != "undefined" )
      {
      delete this.items[a];
      // deselect the area
      }
      else
      {
      this.items[a] = 1;
      // (re-)select the area
      }
      }
      };

      <map ...>
      <area ... onclick="areas. toggle('area51' ); return false">
      ...
      </map>


      F'up2 comp.lang.javas cript (please do not crosspost over hierarchies)

      PointedEars

      Comment

      Working...