Note that there are some explanatory texts on larger screens.

plurals
  1. POChange the position of a sprite image set as background using click on image mapping
    primarykey
    data
    text
    <p>I have searched for about an hour to find a solution to my problem but I can't find much help. </p> <p>I have a div with sprite image set as a background image, so that one image sits on top of the other in a single jpg. And when you hover over the div it changes the position of the sprite image so that you see an alternative state.</p> <p>I want to use image mapping so that when you click on one section of the background image, this will change the positioning of the sprite background image to display the alternative state. clicking on it again will return it to it's original state.</p> <p>I hope this makes sense and thank you for your time.</p> <pre><code>.imageswap { list-style: none; height: 495px; width: 940px; display: block; background: url('/HTMLContent/images/frozenpeas_web_sprite3.jpg') 0 0; } .imageswap:hover{ background-position: 0 -495px; } </code></pre> <pre><code>&lt;div class="ContentBorders imageswap" style="margin:0 auto;"&gt; &lt;div class="textandlogo" style="width: 249px; height: 145px; padding: 0; z-index: 99; float: left;"&gt; &lt;img src="/HTMLContent/images/frozenpeas_logo.png" height="94" width="344" /&gt; &lt;p class="sucktextblack" style="text-align: left; padding: 0 0 0 17px; margin: 0; width: 255px;"&gt; &lt;strong&gt;Make Ice Balls&lt;/strong&gt;&lt;br /&gt; Ice cubes and a refreshing drink go together like peas in a pod, which is why we bring you the frozen peas ice cube mould! Frozen ice peas home-grown from your own freezer and completely reusable. Perfect for hap-pea occasions or just for vegging out in front of the TV. Easy peasy&lt;br /&gt; &lt;span class="sucksmall" style="text-align: left;" &gt;Design by Alessandro Martorelli&lt;/span&gt; &lt;/p&gt; &lt;/div&gt; &lt;div style="width: 202px; height: 202x; padding:0; margin: 270px 20px 0 0; z-index: 98; float: right;"&gt; &lt;img src="/HTMLContent/images/frozenpeas_circle.png" height="202" width="202" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload