I want to create an imagemap with links to new passages, so I have to do the passage call in HTML.
In Sugarcube there is a way by using the data-passage attribute on elements like:
<a data-passage ="test"> foo </a>
or even
<a data-passage="test" class="map_link" id="map_link_0" title=""></a>
inside of an img element with image maps.
But this does not work in Harlowe, and I didn't find anything related to this topic. Could anyone give me some hints?
Comments
The whole code looks like:
The first part went into the css file, the sceond is written in the passage. Twine displays my picture with the map properly, and the links are also where they should be, but since I want to display a certain passage instead of a HTML-site, I guess I would need the appropriate javascript function to go over to the new passage when clicking on one of the areas defined above.
When I simply write your code snippet inside the div container above, it won't work.
Could I use onclick="javascript:..." inside the map_link containers or something like that?
I've found out that if you use this syntax:
it'll work fine, but again -- not within an HTML codeblock...
Try it this way:
It has worked for me before.
<img src = "IMAGE URL"; width=100% height=auto alt="Locations" usemap="#Locations">
<map name = "Locations">
[<area shape= "rect" coords = "0,0,82,126" alt="FirstPassage" >]<HookLink1|(click: ?HookLink1)[(goto: "FirstPassage")]
[<area shape= "rect" coords = "90,0,161,126" alt="SecondPassage" >]<HookLink2|(click: ?HookLink2)[(goto: "SecondPassage")]
</map>