How to make a mapped image responsive?
-
I may be going about this wrong but here is my dilemma.
Twenty Twelve theme. Featured image for the Front Page Template.
I need the image which consists of multiple products to be mapped so that when a visitor clicks on a particular product image, they are taken to the corresponding product page.
The featured image worked well in the responsive layout but when I copied and pasted the mapped image it is no longer responsive causing it to look strange on a mobile phone. The site is guenschel.com so you can see the image and what I am trying to achieve.
Below is the default template and my child template modified.
<?php while ( have_posts() ) : the_post(); ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-page-image"> <?php the_post_thumbnail(); ?> </div><!-- .entry-page-image --> <?php endif; ?> <?php get_template_part( 'content', 'page' ); ?> <?php endwhile; // end of the loop. ?>
and now the child…
<?php while ( have_posts() ) : the_post(); ?> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-page-image"> <img src="https://guenschel.com/hgi/images/PI.jpg" usemap="#jd79081" width="400" height="800" alt="click map" border="0" /> <map id="jd79081" name="jd79081"> <!-- Region 1 Viewall --> <area shape="rect" alt="Viewall Product Line" title="Viewall Product Line" coords="52,114,348,234" href="https://guenschel.com/hgi/viewall/" target="_self" /> <!-- Region 2 Vista --> <area shape="rect" alt="Vista Product Line" title="Vista Product Line" coords="49,248,348,362" href="https://guenschel.com/hgi/vista/" target="_self" /> <!-- Region 3 Accession --> <area shape="rect" alt="Accession Product Line" title="Accession Product Line" coords="49,380,348,486" href="https://guenschel.com/hgi/accession/" target="_self" /> <!-- Region 4 Viewall Front --> <area shape="rect" alt="Viewall Glass Panel System" title="Viewall Glass Panel System" coords="49,550,349,659" href="https://guenschel.com/hgi/glass-panel-systems/" target="_self" /> <!-- Region 5 Vista Front --> <area shape="rect" alt="Vista Glass Panel System" title="Vista Glass Panel System" coords="52,680,346,787" href="https://guenschel.com/hgi/glass-panel-systems/" target="_self" /> <area shape="default" nohref alt="" /> </map> </div><!-- .entry-page-image --> <?php endif; ?> <?php get_template_part( 'content', 'page' ); ?> <?php endwhile; // end of the loop. ?>
What do I need to do to make this image responsive? Am I going about this wrong? Thanks.
- The topic ‘How to make a mapped image responsive?’ is closed to new replies.