Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image Map.
#1
Hi,

    Does anyone know how to fill color into image map?


Thanks in advance
Reply
#2
Hey, In which platform do you want to achieve it?
Because, Using jQuery We can do this task.
Santosh Kokatnur
C#, .NET Developer,
Banglore
India.
[Image: logo.jpg]
Reply
#3
In ASP.NET. Yes I tried with the jquery, but it was not working for me.

This is the JQUERY I have used "jquery.maphilight.js"


Code:
<script type="text/javascript">
      //alert('hi');
      $(function () {
          //alert('hi');
          $('.TestMap').maphilight();
      });
  </script>
Reply
#4
Code to fill color into Image Map Area using JQUERY.


Please find the code below to fill the color for Image Map Area.


1. Include the two jquery files.

Code:
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.maphilight.min.js" type="text/javascript"></script>

2. Add Jquery code as below.

Code:
 <script type="text/javascript">
       $(function () {
           $("area").data('maphilight', { alwaysOn: true }).trigger('alwaysOn.maphilight');
           $('.map').maphilight();
       });
   </script>

3. There is a default color set for the area. You can change it in the jquery file:
Code:
jquery.maphilight.min.js

Note: To change the color first find the defaults in the jquery file and than look for fill-color, there you can change color for the area.

Thank you santosh, I have achieved it using the above.

Please share if you find it helpful.
Thanks..
Reply
#5
Hi,

Let me know if anyone knows.

The same as above I want to achieve if dynamically, meaning I want to fill different color for different area and I want to pass the color dynamically from the database based on area. Please let me know how can I achieve it.

Please comment below if you need any more details.


Thank you
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Star How to cut/split a image horizontally into two parts in c#? ChannuShahapur 0 1, 967 06-10-2015, 05:06 PM
Last Post: ChannuShahapur

Forum Jump:


Users browsing this thread: 1 Guest(s)