onclilck variable

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

    onclilck variable



    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.

    For instance:
    chevronclick=0 on load.
    clicking at chevron 4 would set the variable to 4.
    The proper url selected by the variable.

    thanks.



  • The Plankmeister

    #2
    Re: onclilck variable

    > For instance:[color=blue]
    > chevronclick=0 on load.
    > clicking at chevron 4 would set the variable to 4.
    > The proper url selected by the variable.[/color]

    I'm pretty sure that just declaring a global variable as the first line
    inside your script, then setting it with an onclick would work... thus:

    [snip]
    var chevronclick = 0;
    if(document.ima ges) {
    pics = new Array(12);
    pics[1] = new Image();
    pics[1].src = "main.gif";
    [snip]

    [snip]
    <AREA SHAPE="CIRCLE" COORDS="110,60,-41" HREF="#"
    onClick="chevro nclick=4" onMouseOver="ch anger('img1',4) ">
    [snip]


    I've not tested this but that should work.

    Alternatively, why not just put the appropriate URL in the HREF? From what I
    can see that would be an easier approach. But I'm not privy to all the facts
    :)

    HTH.

    P.


    Comment

    Working...