onclick and variables

Discussion in 'HTML' started by Richard, Sep 16, 2003.

  1. Richard

    Richard Guest

    http://1-large-world.com/stargate/map2.html

    When you mouse over one of the chevrons, the main image changes.
    What I'd like do next is to have an onclick instead of onmouseout.
    So that a variable would tell the function which new area to go to.
    I know this is most likely handled in javascript, can it be done in html?
    For instance:
    chevronclick=0 on load.
    clicking at chevron 4 would set the variable to 4.
    The proper url selected by the variable.
    I will also post this in the javascript group.

    thanks.
     
    Richard, Sep 16, 2003
    #1
    1. Advertising

  2. Richard

    rf Guest

    "Richard" <anom@anom> wrote in message
    news:...
    > http://1-large-world.com/stargate/map2.html
    >
    > When you mouse over one of the chevrons, the main image changes.


    This looks very much like mystery meat navigation.

    > What I'd like do next is to have an onclick instead of onmouseout.
    > So that a variable would tell the function which new area to go to.
    > I know this is most likely handled in javascript, can it be done in html?
    > For instance:
    > chevronclick=0 on load.
    > clicking at chevron 4 would set the variable to 4.
    > The proper url selected by the variable.


    Er, why. Why not just use the built-in onclick handler provided by the <area
    href=...> element? That is, after all, what an area element if for :)

    > I will also post this in the javascript group.


    Crosspost next time. That way everybody gets to see all the responses.

    Cheers
    Richard.
     
    rf, Sep 16, 2003
    #2
    1. Advertising

  3. Richard

    Richard Guest

    rf wrote:>>


    > "Richard" <anom@anom> wrote in message
    > news:...
    >> http://1-large-world.com/stargate/map2.html
    >>
    >> When you mouse over one of the chevrons, the main image changes.


    > This looks very much like mystery meat navigation.


    >> What I'd like do next is to have an onclick instead of onmouseout.
    >> So that a variable would tell the function which new area to go to.
    >> I know this is most likely handled in javascript, can it be done in
    >> html? For instance: chevronclick=0 on load. clicking at chevron 4 would
    >>set the variable to 4. The proper url selected by the variable.


    > Er, why. Why not just use the built-in onclick handler provided by the
    > <area href=...> element? That is, after all, what an area element if for
    > :)


    That's what I want to know. What is the proper syntax for doing it that way?
    What I have tried results in an error. as with mouseover, it is expected to
    find a script of some sort.
    I've been searching on the web and have found no answers to that yet.


    >> I will also post this in the javascript group.


    > Crosspost next time. That way everybody gets to see all the responses.


    > Cheers
    > Richard.
     
    Richard, Sep 16, 2003
    #3
  4. Richard

    rf Guest

    "Richard" <anom@anom> wrote in message
    news:...
    > rf wrote:>>
    >
    >
    > > "Richard" <anom@anom> wrote in message
    > > news:...
    > >> http://1-large-world.com/stargate/map2.html


    > > Er, why. Why not just use the built-in onclick handler provided by the
    > > <area href=...> element? That is, after all, what an area element if

    for
    > > :)

    >
    > That's what I want to know. What is the proper syntax for doing it that

    way?
    > What I have tried results in an error. as with mouseover, it is expected

    to
    > find a script of some sort.
    > I've been searching on the web and have found no answers to that yet.


    Hmmm. <AREA onmouseover="changer('img1',2)" shape=CIRCLE coords=69,347,-41
    href="http://google.com/"> ?

    Cheers
    Richard.
     
    rf, Sep 16, 2003
    #4
  5. Richard

    Richard Guest

    Richard wrote:>>

    > http://1-large-world.com/stargate/map2.html


    > When you mouse over one of the chevrons, the main image changes.
    > What I'd like do next is to have an onclick instead of onmouseout.
    > So that a variable would tell the function which new area to go to.
    > I know this is most likely handled in javascript, can it be done in html?
    > For instance:
    > chevronclick=0 on load.
    > clicking at chevron 4 would set the variable to 4.
    > The proper url selected by the variable.
    > I will also post this in the javascript group.


    > thanks.



    Figured it out I think.
    <area................onClick="window.location='http://www.site.com'">
    at least it works.
     
    Richard, Sep 16, 2003
    #5
  6. Richard

    rf Guest

    "Richard" <anom@anom> wrote in message
    news:...
    > Richard wrote:>>
    >
    > > http://1-large-world.com/stargate/map2.html

    >
    > > When you mouse over one of the chevrons, the main image changes.
    > > What I'd like do next is to have an onclick instead of onmouseout.
    > > So that a variable would tell the function which new area to go to.
    > > I know this is most likely handled in javascript, can it be done in

    html?
    > > For instance:
    > > chevronclick=0 on load.
    > > clicking at chevron 4 would set the variable to 4.
    > > The proper url selected by the variable.
    > > I will also post this in the javascript group.

    >
    > > thanks.

    >
    >
    > Figured it out I think.
    > <area................onClick="window.location='http://www.site.com'">
    > at least it works.


    Not with javascript disabled :)

    Cheers
    Richard.
     
    rf, Sep 16, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    964
  2. Replies:
    9
    Views:
    1,006
  3. bob
    Replies:
    3
    Views:
    235
  4. Replies:
    2
    Views:
    278
  5. Replies:
    4
    Views:
    208
Loading...

Share This Page