is it possible to style different areas in different styles in imagemapster? For exampl: when I have a plan of a house a user can click different rooms: living-rooms, sleeping-rooms, bath-rooms, ... . Any selected living-room should be rendered in red, any selected sleeping-room should be selected blue ... thanks Kurt
标签:
imagemapster
相关问题
- Javascript in Edge only works with devtools open
- jQuery plugin imagemapster isn't doing anythin
- Highlight text when hover imagemap area and vice v
- imagemapster: rendering “different” styles for dif
- ImageMapper Beatles demo won't run outside jsF
相关文章
- Highlight text when hover imagemap area and vice v
- imagemapster: rendering “different” styles for dif
- ImageMapper Beatles demo won't run outside jsF
- 如何获取路径与图像的地图使用形状的中心坐标?(How to get the path coordin
- ImageMapster (JavaScript)- “onClick” function wont
- How to get the path coordinates of a shape for use
There's no built-in way right now to create a profile that applies to a group of independent areas, but you can do it yourself with just a little bit of work. Here's a working example:
http://jsfiddle.net/jamietre/RyScW/
First set up a cross-reference:
Then, map the profiles to a new object to make it easy to access them using the "mapKey" for each area:
This converts the simple structure you just created into an object that looks like this:
Finally, intercept "clicks" and select the area manually using the specific options:
The
return false
causes ImageMapster to cancel its own click handling. That's it.Also for completeness -- you could just do this the old-fashioned way and assign the options to each area:
The direct way to do this is by adding specific information to each area up front, e.g.
This would obviously be a lot of data if you had many areas, with a lot of repetition. It's more efficient and a lot less markup to do it the other way.