Search code examples
csscolorshyperlinkimagemap

How can I change the color property of a hyperlink on mouse over of an image map?


I was browsing other user questions a few minutes ago.. and it led me to trying to change the hover color of the hyperlink on mouse over of my image map.

Any idea how I might accomplish this for the 1 hyperlink I have up?

http://www.urlgone.com/d7ccf8/


Solution

  • You're using jquery as i can see. So do something like that:

    <script>
        $(document).ready(function() {
            $("area[shape='poly']").mouseover(function() {
                var id = $(this).attr('id');
                $('a.staffs').removeClass('active'); //make other link not ative
                $('a.staff-' + id).addClass('active');
            }).mouseout(function() {
                $('a.staffs').removeClass('active');
            });
        });
    </script>
    

    And CSS (you have to change it to your style):

    <style>
        .active {
            color:red;
            text-decoration:underline;  
        }
    </style>