Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Is there a way to use the click macro with imagemap?

edited May 2016 in Help! with 2.0
So linking to a passage with imagemap link is simple enough (just change the href to data-passage) but I was wondering if there was a way to use the <<click>> macro with imagemap coordinates as the link so I can set variables before loading the next passage.

Does anyone have any experience with something like that?

Comments

  • edited May 2016
    You cannot use the <<click>> macro within an imagemap.

    As noted in the HTML Attributes section of the Markup doc, however, you should be able to use the data-setter attribute within your <area> tags to set variables. For example:
    <area shape="…" coords="…" data-passage="…" data-setter="$lakePathFollowed++">
    <area shape="…" coords="…" data-passage="…" data-setter="$bought to 'milk'">
    
    n.b. As with any use of HTML attributes, you must be mindful of your quotes when setting strings within the setter.
Sign In or Register to comment.