Problems with show() in IE with image map using hilight plugin
I have an input which has an onclick event that will display (show()) the maphilight content within a div (initial css display:none) when in focus. My problem is strange and only seems to effect IE. That is the image map within the div does not display when the div is revealed by the onclick event. The div does display however the map is not displaying. If I remove the css display:none attribute it dipslays fine (but not as i need it obviously), so it appears to be a issue with IE not processing the image map as it has the initial state display:none. No js errors present. I have tried several different work arounds for this with little joy. Does anyone know what may be happening here?
Full example below. Any help appreciated. Thanks.
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title>temp map</title>
- <style type="text/css">
- #searchit {
- display:none;
- margin-right:30px;
- padding-top:0;
- margin-top:0;
- width:895px;
- height:510px;
- margin-left:235px;
- border:1px #000 solid;
- }
- </style>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js" type="text/javascript"></script>
- <script type="text/javascript" src="http://davidlynch.org/js/maphilight/jquery.maphilight.min.js"></script>
- <script type="text/javascript">
- $(function() {
- $('.map').maphilight();
- });
- $.fn.maphilight.defaults = {
- fill: true,
- fillColor: '333333',
- fillOpacity: 1,
- stroke: true,
- strokeColor: 'CCCCCC',
- strokeOpacity: 1,
- strokeWidth: 2,
- fade: true,
- alwaysOn: false,
- neverOn: false,
- groupBy: false
- }
- </script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('#displaysearch').focus(function(s) {
- s.preventDefault();
- $('#searchit').slideDown('slow');
- $('#hidesearch').show();
- });
- $('#hidesearch').click(function(s) {
- s.preventDefault();
- $('#searchit').slideUp('slow');
- $('#hidesearch').hide();
- });
- $(".click").hover(function(){
- pos = $(this).attr("id");
- $('#Location').val(pos);
- });
- });
- </script>
- </head>
- <body>
- <div id="header">
- <div id="search_opener">
- <span id="searchstart">Search</span><br/>
- <input id="displaysearch" name="displaysearch" type="text" /><br/>
- <a href="#" id="hidesearch">CLOSE SEARCH WINDOW</a>
- <!-- end #search_opener --></div>
- <!-- end header --></div>
- <div id="searchit">
- <map name="mymap">
- <area shape="circle" coords="70,84,51" href="http://www.december.com" class="click">
- <area shape="rect" coords="25,180,125,280" href="http://www.december.com/html/" class="click">
- <area shape="poly" coords="153,106,186,225,340,193,315,81,304,167" href="http://www.december.com/works/tour.html" class="click">
- <area shape="rect" coords="420,19,478,278" Nohref class="click">
- <area shape="circle" coords="499,299,100" href="http://www.cnn.com/" class="click">
- <area shape="default" coords="0,0,500,300" href="http://www.december.com/john/" class="click">
- </map>
- <img src="http://www.december.com/html/images/imagemap.gif" width="500" height="300" alt="Image Map" usemap="#mymap" class="map" ismap>
- <!-- end #searchit --></div>
- </body>
- </html>