Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is what I ended up doing. There are four images I use in my slide show: the main image, and then left, right, close button images.</p> <pre><code>main_img = $("&lt;img ... class='main-photo slide-show'/&gt;"); close_img = $("&lt;img ... class='nav-button slide-show'/&gt;"); left_img = $("&lt;img ... class='nav-button slide-show'/&gt;"); right_img = $("&lt;img ... class='nav-button slide-show'/&gt;"); </code></pre> <p>The classes here are essentially empty, but help me to select based on above answers. The main image then shows without navigation buttons, and I attach these event handler functions:</p> <pre><code>$(".slide-show").mouseenter(function() { $(".photo-nav:hidden").placeShow(); }); $(".slide-show").mouseleave(function() { $(".photo-nav").hide(); }); </code></pre> <p>where the placeShow() moves the navigation buttons into their respective places. This function is defined as follows:</p> <pre><code>$.fn.placeShow = function() { var pos = main_img.position(); var left = pos.left; var top = pos.top; var width = main_img.width(); var height = main_img.height(); close_img.css({ "left":"" + (left-15) + "px", "top":"" + (top-15) + "px" }).show(); left_img.css({ "left":"" + (left+(width/2)-36) + "px" , "top": "" + (top+height-15) + "px" }).show(); right_img.css({ "left":"" + (left+(width/2)+3) + "px", "top":"" + (top+height-15) + "px" }).show(); } </code></pre> <p>This worked so far on Safari, IE, FF, Chrome (well, the versions I've got here...)</p> <p>Let me know what you think, if I can trim this code more, or if there are alternative solutions that would be more elegant/fast. The final result of all this is on my website now.</p> <p>Jens</p>
    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. 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