Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This method involves a little jquery, but works fantastic in most situations... let me explain:</p> <p>if all the images of the slideshow are contained within their own element div pos:absolute and those images are pos:relative, then on a $(window).load() you can run a .each() and find each img in the slideshow and adjust it's top positioning to be offset a certain number of pixels from the top..</p> <p>jcycle automatically sets each parent div containing the image to pos:absolute on every onafter() so it's useless to apply this pos adjustment to them... instead target each img you have set to pos:relative...</p> <p>Here is the example:</p> <pre><code>$(window).load(function() { // move all slides to the middle of the slideshow stage var slideshowHeight = 600; //this can dynamic or hard-coded $('.slideImg').each(function(index) { var thisHeight = $(this).innerHeight(); var vertAdj = ((slideshowHeight - thisHeight) / 2); $(this).css('top', vertAdj); }); }); </code></pre> <p>and this is the html it's working on...</p> <pre><code>&lt;div class="slideshow" style="position: relative; "&gt; &lt;div style="position: absolute; top: 0px; left: 0px; display: none; width: 1000px; height: 600px; " id="img0"&gt; &lt;img class="slideImg" src="/images/picture-1.jpg" style="top: 0px; "&gt;&lt;!-- the style=top:0 is a result of the jquery --&gt; &lt;/div&gt; &lt;div style="position: absolute; top: 0px; left: 0px; display: none; width: 1000px; height: 600px; " id="img1"&gt; &lt;img class="slideImg" src="/images/picture-1.jpg" style="top: 89.5px; "&gt;&lt;!-- the style=top:89.5px is a result of the jquery --&gt; &lt;/div&gt; &lt;div style="position: absolute; top: 0px; left: 0px; display: none; width: 1000px; height: 600px; " id="img2"&gt; &lt;img class="slideImg" src="/images/picture-1.jpg" style="top: 13px; "&gt;&lt;!-- the style=top:13px is a result of the jquery --&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>just make sure </p> <pre><code>.slideImg { position:relative; } </code></pre> <p>I think that's everything... I have an example, but it's on a dev site.. so this link might not last.. but you can take a look at it here: <a href="http://beta.gluemgmt.com/portfolio/rae-scarton-editorial.html" rel="nofollow">http://beta.gluemgmt.com/portfolio/rae-scarton-editorial.html</a></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. 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