Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery Cycle + Firefox Squishing Images
    primarykey
    data
    text
    <p>Hey guys, I'm running jQuery Cycle for an image gallery. View the link: <a href="http://www.jasonmeyers.net/dev/events/march-9th-2006-the-social/" rel="noreferrer">Here</a></p> <p>My problem is that the images are getting squished when viewed in firefox. The problem disappears when I re-load the page. This leads me to believe that the Javascript is triggering before all the images are loaded (usually the first image works fine and the rest are squished.)</p> <p>A hard re-fresh reproduces the problem.</p> <p>I've wrapped everything in a $(document).ready(function(){ }); but it still happens.</p> <p><strong>Additional Info:</strong> If I specify the width and height of the image, everything works fine. However there are hundreds of images all at different sizes.. </p> <p>I'm pretty frustrated with this problem. Any ideas/help is greatly appreciated! </p> <p>Here is my code:</p> <pre><code>$(document).ready(function(){ //function onBefore(curr,next,opts) { // var $slide = jQuery(next); // var w = $slide.outerWidth(); // var h = $slide.outerHeight(); // $slide.css({ // marginTop: (482 - h) / 2, // marginLeft: (560 - w) / 2 // }); //}; // Decare the function that center the images... function onBefore(curr,next,opts) { var $slide = jQuery(next); var w = $slide.outerWidth(); var h = $slide.outerHeight(); $slide.css({ marginTop: (480 - h) / 2, marginLeft: (560 - w) / 2 }); }; $(document).ready(function() { $('#slideshow').cycle({ fx: 'fade', next: '#next', pause: 0, speed: 500, before: onBefore, prev: '#prev', pause: '#pause', pager: '.thumbs', pagerClick:function(zeroBasedSlideIndex, slideElement) {$(slideElement).find('div.cover').hide();}, pagerAnchorBuilder: function(idx, slide) { var src = $('img',slide).attr('src'); //Change height of thumbnail here return '&lt;li&gt;&lt;a href="#"&gt;&lt;img src="' + slide.src + '" height="90" /&gt;&lt;/a&gt;&lt;/li&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.
 

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