Navigation Demo - Simple
Simple example of Navigation comparing ClickNavigate and OnClick
navigation support between legacy ImageMapster behavior and behavior added
in v1.5.0.
Prior to v1.5.0, behavior worked as described in navigateMode of
`location`. As of v1.5.0, the default behavior remains `location` for
backwards compat, however navigateMode can be set to `open` which will
provide the following fixes/benefits:
-
All navigation is performed using window.open instead of
window.location.href which allows for support of hyperlinks as well as
mailto, etc.
-
If specified, target property of area element will be retrieved and
passed to window.open call. If no target is provided, a default of
`_self` is used to mirror legacy behavior.
-
href & target value will always look first at the specific AREA element
clicked and if no href is specified, use the AreaData default which is
the first AREA element that ImageMapster found for the primaryKey
identified via mapKey. If mapKey configuration property is not
specified, each AREA is configured with a unique primaryKey so the href
will come from AreaData but will be the same value as the AREA element
since areas will not be grouped.
You can toggle the values of navigateMode and clickNavigate. The expected
result when clicking a member of the band is:
navigateMode |
clickNavigate |
Paul |
Ringo |
John |
George |
location |
false |
Paul |
Ringo |
John |
George |
true |
Paul |
Paul |
Paul |
Paul |
open |
false |
Paul |
Ringo |
John |
George |
true |
Paul |
Ringo |
John |
George |