Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's a simple one based on your fiddle. <a href="http://jsfiddle.net/RnnrA/" rel="nofollow">http://jsfiddle.net/RnnrA/</a></p> <p>Like with most things in web design there's millions of ways to do something. If you can give us more details (where is the image, for example) I could give you a better way of doing it.</p> <pre><code>$("li a").mouseover(function(){ $("#img_"+$(this).attr("id")).show(); }); $("li a").mouseout(function(){ $("#img_"+$(this).attr("id")).hide(); }); </code></pre> <p>This one's a little more complex: <a href="http://jsfiddle.net/e7UVb/" rel="nofollow">http://jsfiddle.net/e7UVb/</a></p> <p>I made a div that holds the image and everytime you mouse over it creates an image element and populates it with an image then appends it to the div. on mouseout it destroys the image element. This will require more client calls because everytime you mouse over it needs to go get the image. In my example I only used one image, you'll have to use some better logic to figure out which image to display for this one.</p> <pre><code>$("li a").mouseover(function(){ $("#imagePlaceholder").append($("&lt;img&gt;&lt;/img&gt;").prop("src","http://www.psdgraphics.com/file/psd-credit-card.jpg").prop("height","50")); }); $("li a").mouseout(function(){ $("#imagePlaceholder").empty(); }); </code></pre> <p>Finally, a much simpler version: <a href="http://jsfiddle.net/Zt2pu/1/" rel="nofollow">http://jsfiddle.net/Zt2pu/1/</a></p> <pre><code>$("li a").mouseover(function(){ $("#imagePlaceholder").prop("src","http://www.psdgraphics.com/file/psd-credit-card.jpg").prop("height","50"); }); $("li a").mouseout(function(){ $("#imagePlaceholder").prop("src",""); }); </code></pre> <p>Here I just made an empty image tag, and on mouseover I changed the src attribute. On mouse out I emptied the src attribute. Just like the previous one, you'll have a client call to download the image on every mouse over.</p> <p>Bottom line, the top one is the simplest and easiest. The client will load all of the images once and only once so there will only be the initial call to download all the images.</p> <p>again, give us a better idea of what you're actually doing and we can give you a better answer on how to accomplish that. In the meantime, have fun with this. </p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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