Note that there are some explanatory texts on larger screens.

plurals
  1. POmootools Fx.scroll with centered images
    primarykey
    data
    text
    <p>im not a mootools prof, so i think for one with more experience the solution for my little problem is quite smiple. </p> <p>I have a simple Image galery with a square Image for "big" Imagepreview. It uses 5 images. The image id to set, comes from a carousel. In the moment it looks (in short) like this:</p> <pre><code>&lt;script type="text/javascript"&gt; function slide(pic_thumb) { // Galerie Slides var pic = pic_thumb; myFx = new Fx.Scroll('gallery'); myFx.toElement('medium_slice_image_'+(pic)); } </code></pre> <p></p> <pre><code> &lt;div id="gallery" style="overflow:hidden;position:relative;z-index:2;"&gt; &lt;table cellpadding="0" cellspacing="0"&gt; &lt;tr&gt; &lt;td style="vertical-align:middle; text-align: center;"&gt; &lt;a id="link_0" href=""&gt;&lt;img id="medium_slice_image_0" src=""&gt;&lt;/a&gt; &lt;/td&gt; &lt;td style="vertical-align:middle; text-align: center;"&gt; &lt;a id="link_1" href=""&gt;&lt;img id="medium_slice_image_1" src=""&gt;&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; ..... &lt;div id='thumb_{$counter}' style="width:81px;height:48px;float:left;margin-top:1px;margin-left:7px;" onclick="slide({$counter})"&gt; </code></pre> <p>Till now i used for the Big image to preview also sqaured images, but i would like to prefer using the orignal images for the preview keeping the original aspect ratio so that a wide image will be e.g. vertically centered. </p> <p>My problem is, that the fx.scroll uses the image size as point to scroll. so that two smaller images (150x150 px) would be both shown directly together in the preview window (300x300 px).</p> <p>I have no idea how i can solve this so that each images uses the fully 300x300 px size to scroll, even it is smaller and centered. </p> <p>Please help me. Thank you</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.
 

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